diff --git a/app/win/iat_patch_function.cc b/app/win/iat_patch_function.cc
index 3f90d81a22fb93cce9e89e029c911eceb71a006f..a78a357e8a67384327431bf7a433efd91b35c90d 100644
--- a/app/win/iat_patch_function.cc
+++ b/app/win/iat_patch_function.cc
@@ -5,6 +5,7 @@
 #include "app/win/iat_patch_function.h"
 
 #include "base/logging.h"
+#include "base/win/pe_image.h"
 
 namespace app {
 namespace win {
@@ -79,7 +80,7 @@ DWORD ModifyCode(void* old_code, void* new_code, int length) {
   return error;
 }
 
-bool InterceptEnumCallback(const PEImage &image, const char* module,
+bool InterceptEnumCallback(const base::win::PEImage& image, const char* module,
                            DWORD ordinal, const char* name, DWORD hint,
                            IMAGE_THUNK_DATA* iat, void* cookie) {
   InterceptFunctionInformation* intercept_information =
@@ -147,7 +148,7 @@ DWORD InterceptImportedFunction(HMODULE module_handle,
     return ERROR_INVALID_PARAMETER;
   }
 
-  PEImage target_image(module_handle);
+  base::win::PEImage target_image(module_handle);
   if (!target_image.VerifyMagic()) {
     NOTREACHED();
     return ERROR_INVALID_PARAMETER;
diff --git a/app/win/iat_patch_function.h b/app/win/iat_patch_function.h
index 37961dd9463d976e57bbef667dc58f9bf914893d..4a2aa0c69b25b5c5b7047797b755bbabab541d91 100644
--- a/app/win/iat_patch_function.h
+++ b/app/win/iat_patch_function.h
@@ -9,7 +9,6 @@
 #include <windows.h>
 
 #include "base/basictypes.h"
-#include "base/pe_image.h"
 
 namespace app {
 namespace win {
diff --git a/base/base.gyp b/base/base.gyp
index e4328151b2a5e424426c6e06bd6e5f07f763bba6..5145404df5d3eef1c6fbb5805e34ecd9fc169674 100644
--- a/base/base.gyp
+++ b/base/base.gyp
@@ -113,7 +113,6 @@
         'object_watcher_unittest.cc',
         'observer_list_unittest.cc',
         'path_service_unittest.cc',
-        'pe_image_unittest.cc',
         'pickle_unittest.cc',
         'platform_file_unittest.cc',
         'platform_thread_unittest.cc',
@@ -123,7 +122,6 @@
         'process_util_unittest_mac.mm',
         'rand_util_unittest.cc',
         'ref_counted_unittest.cc',
-        'registry_unittest.cc',
         'scoped_native_library_unittest.cc',
         'scoped_ptr_unittest.cc',
         'scoped_temp_dir_unittest.cc',
@@ -165,6 +163,8 @@
         'watchdog_unittest.cc',
         'weak_ptr_unittest.cc',
         'win_util_unittest.cc',
+        'win/pe_image_unittest.cc',
+        'win/registry_unittest.cc',
         'win/scoped_bstr_unittest.cc',
         'win/scoped_comptr_unittest.cc',
         'win/scoped_variant_unittest.cc',
@@ -221,11 +221,6 @@
             'event_trace_controller_win_unittest.cc',
             'event_trace_provider_win_unittest.cc',
             'object_watcher_unittest.cc',
-            'pe_image_unittest.cc',
-            'registry_unittest.cc',
-            'scoped_bstr_win_unittest.cc',
-            'scoped_comptr_win_unittest.cc',
-            'scoped_variant_win_unittest.cc',
             'system_monitor_unittest.cc',
             'time_win_unittest.cc',
             'trace_event_win_unittest.cc',
diff --git a/base/base.gypi b/base/base.gypi
index b608e8283432f18d3b612be7647468d0fbb9f7d4..b449a89da11b46a225df4e5d9cfe9f7f117200c7 100644
--- a/base/base.gypi
+++ b/base/base.gypi
@@ -156,8 +156,6 @@
           'observer_list_threadsafe.h',
           'path_service.cc',
           'path_service.h',
-          'pe_image.cc',
-          'pe_image.h',
           'pickle.cc',
           'pickle.h',
           'platform_file.h',
@@ -189,8 +187,6 @@
           'ref_counted.h',
           'ref_counted_memory.cc',
           'ref_counted_memory.h',
-          'registry.cc',
-          'registry.h',
           'resource_util.cc',
           'resource_util.h',
           'safe_strerror_posix.cc',
@@ -295,6 +291,10 @@
           'watchdog.h',
           'weak_ptr.cc',
           'weak_ptr.h',
+          'win/pe_image.cc',
+          'win/pe_image.h',
+          'win/registry.cc',
+          'win/registry.h',
           'win/scoped_bstr.cc',
           'win/scoped_bstr.h',
           'win/scoped_comptr.h',
diff --git a/base/file_util_win.cc b/base/file_util_win.cc
index 213833b336ebfca7b9ae859e5d7a8ec79002290c..d9f84045f9dedffdeb731411109b7c228ac23fc4 100644
--- a/base/file_util_win.cc
+++ b/base/file_util_win.cc
@@ -15,7 +15,7 @@
 #include "base/file_path.h"
 #include "base/logging.h"
 #include "base/metrics/histogram.h"
-#include "base/pe_image.h"
+#include "base/win/pe_image.h"
 #include "base/win/scoped_handle.h"
 #include "base/string_number_conversions.h"
 #include "base/string_util.h"
@@ -1051,7 +1051,7 @@ bool PreReadImage(const wchar_t* file_path, size_t size_to_read,
     if (!dll_module)
       return false;
 
-    PEImage pe_image(dll_module);
+    base::win::PEImage pe_image(dll_module);
     PIMAGE_NT_HEADERS nt_headers = pe_image.GetNTHeaders();
     size_t actual_size_to_read = size_to_read ? size_to_read :
                                  nt_headers->OptionalHeader.SizeOfImage;
diff --git a/base/registry.h b/base/registry.h
index 7584de019aa79f0c6e38c1e66a5855e05ccf8b3b..5ef45f2d744c0a8c5eacc1bf9a92e27347f9131a 100644
--- a/base/registry.h
+++ b/base/registry.h
@@ -6,160 +6,34 @@
 #define BASE_REGISTRY_H_
 #pragma once
 
-#include <windows.h>
-#include <string>
+// TODO(brettw) remove this file when all callers are converted to using the
+// new location & namespace.
+#include "base/win/registry.h"
 
-#include "base/basictypes.h"
-
-// Utility class to read, write and manipulate the Windows Registry.
-// Registry vocabulary primer: a "key" is like a folder, in which there
-// are "values", which are <name, data> pairs, with an associated data type.
-class RegKey {
+class RegKey : public base::win::RegKey {
  public:
-  RegKey();
-  RegKey(HKEY rootkey, const wchar_t* subkey, REGSAM access);
-  ~RegKey();
-
-  bool Create(HKEY rootkey, const wchar_t* subkey, REGSAM access);
-
-  bool CreateWithDisposition(HKEY rootkey, const wchar_t* subkey,
-                             DWORD* disposition, REGSAM access);
-
-  bool Open(HKEY rootkey, const wchar_t* subkey, REGSAM access);
-
-  // Creates a subkey or open it if it already exists.
-  bool CreateKey(const wchar_t* name, REGSAM access);
-
-  // Opens a subkey
-  bool OpenKey(const wchar_t* name, REGSAM access);
-
-  void Close();
-
-  DWORD ValueCount();
-
-  // Determine the nth value's name.
-  bool ReadName(int index, std::wstring* name);
-
-  // True while the key is valid.
-  bool Valid() const { return key_ != NULL; }
-
-  // Kill a key and everything that live below it; please be careful when using
-  // it.
-  bool DeleteKey(const wchar_t* name);
-
-  // Deletes a single value within the key.
-  bool DeleteValue(const wchar_t* name);
-
-  bool ValueExists(const wchar_t* name);
-
-  bool ReadValue(const wchar_t* name, void* data, DWORD* dsize, DWORD* dtype);
-  bool ReadValue(const wchar_t* name, std::wstring* value);
-  bool ReadValueDW(const wchar_t* name, DWORD* value);
-
-  bool WriteValue(const wchar_t* name, const void* data, DWORD dsize,
-                  DWORD dtype);
-  bool WriteValue(const wchar_t* name, const wchar_t* value);
-  bool WriteValue(const wchar_t* name, DWORD value);
-
-  // Starts watching the key to see if any of its values have changed.
-  // The key must have been opened with the KEY_NOTIFY access privelege.
-  bool StartWatching();
-
-  // If StartWatching hasn't been called, always returns false.
-  // Otherwise, returns true if anything under the key has changed.
-  // This can't be const because the |watch_event_| may be refreshed.
-  bool HasChanged();
-
-  // Will automatically be called by destructor if not manually called
-  // beforehand.  Returns true if it was watching, false otherwise.
-  bool StopWatching();
-
-  inline bool IsWatching() const { return watch_event_ != 0; }
-  HANDLE watch_event() const { return watch_event_; }
-  HKEY Handle() const { return key_; }
-
- private:
-  HKEY key_;  // The registry key being iterated.
-  HANDLE watch_event_;
-
-  DISALLOW_COPY_AND_ASSIGN(RegKey);
+  RegKey() {}
+  RegKey(HKEY rootkey, const wchar_t* subkey, REGSAM access)
+      : base::win::RegKey(rootkey, subkey, access) {}
+  ~RegKey() { base::win::RegKey::~RegKey(); }
 };
 
-// Iterates the entries found in a particular folder on the registry.
-// For this application I happen to know I wont need data size larger
-// than MAX_PATH, but in real life this wouldn't neccessarily be
-// adequate.
-class RegistryValueIterator {
+class RegistryValueIterator : public base::win::RegistryValueIterator {
  public:
-  RegistryValueIterator(HKEY root_key, const wchar_t* folder_key);
-
-  ~RegistryValueIterator();
-
-  DWORD ValueCount() const;
-
-  // True while the iterator is valid.
-  bool Valid() const;
-
-  // Advances to the next registry entry.
-  void operator++();
-
-  const wchar_t* Name() const { return name_; }
-  const wchar_t* Value() const { return value_; }
-  DWORD ValueSize() const { return value_size_; }
-  DWORD Type() const { return type_; }
-
-  int Index() const { return index_; }
-
- private:
-  // Read in the current values.
-  bool Read();
-
-  // The registry key being iterated.
-  HKEY key_;
-
-  // Current index of the iteration.
-  int index_;
-
-  // Current values.
-  wchar_t name_[MAX_PATH];
-  wchar_t value_[MAX_PATH];
-  DWORD value_size_;
-  DWORD type_;
-
-  DISALLOW_COPY_AND_ASSIGN(RegistryValueIterator);
+  RegistryValueIterator(HKEY root_key, const wchar_t* folder_key)
+      : base::win::RegistryValueIterator(root_key, folder_key) {}
+  ~RegistryValueIterator() {
+    base::win::RegistryValueIterator::~RegistryValueIterator();
+  }
 };
 
-class RegistryKeyIterator {
+class RegistryKeyIterator : public base::win::RegistryKeyIterator {
  public:
-  RegistryKeyIterator(HKEY root_key, const wchar_t* folder_key);
-
-  ~RegistryKeyIterator();
-
-  DWORD SubkeyCount() const;
-
-  // True while the iterator is valid.
-  bool Valid() const;
-
-  // Advances to the next entry in the folder.
-  void operator++();
-
-  const wchar_t* Name() const { return name_; }
-
-  int Index() const { return index_; }
-
- private:
-  // Read in the current values.
-  bool Read();
-
-  // The registry key being iterated.
-  HKEY key_;
-
-  // Current index of the iteration.
-  int index_;
-
-  wchar_t name_[MAX_PATH];
-
-  DISALLOW_COPY_AND_ASSIGN(RegistryKeyIterator);
+  RegistryKeyIterator(HKEY root_key, const wchar_t* folder_key)
+      : base::win::RegistryKeyIterator(root_key, folder_key) {}
+  ~RegistryKeyIterator() {
+    base::win::RegistryKeyIterator::~RegistryKeyIterator();
+  }
 };
 
 #endif  // BASE_REGISTRY_H_
diff --git a/base/pe_image.cc b/base/win/pe_image.cc
similarity index 99%
rename from base/pe_image.cc
rename to base/win/pe_image.cc
index 36eb0e43431c048597ce7a4d2462c9f5f8bb3ff1..76fdbcd89925cc1f5e63b82c32b08147cb3f8d31 100644
--- a/base/pe_image.cc
+++ b/base/win/pe_image.cc
@@ -1,11 +1,14 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
 // This file implements PEImage, a generic class to manipulate PE files.
 // This file was adapted from GreenBorder's Code.
 
-#include "base/pe_image.h"
+#include "base/win/pe_image.h"
+
+namespace base {
+namespace win {
 
 #if defined(_WIN64) && !defined(NACL_WIN64)
 // TODO(rvargas): Bug 27218. Make sure this is ok.
@@ -562,3 +565,6 @@ PVOID PEImageAsData::RVAToAddr(DWORD rva) const {
 
   return in_memory;
 }
+
+}  // namespace win
+}  // namespace base
diff --git a/base/pe_image.h b/base/win/pe_image.h
similarity index 97%
rename from base/pe_image.h
rename to base/win/pe_image.h
index 968d056e8268e745df7c9964ad6594e0a6a71f21..e1205e0ca17c1fafe60c84ceff00912f9f09ab55 100644
--- a/base/pe_image.h
+++ b/base/win/pe_image.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
@@ -8,13 +8,16 @@
 // Win32 Portable Executable File Format" by Matt Pietrek:
 // http://msdn.microsoft.com/msdnmag/issues/02/02/PE/default.aspx
 
-#ifndef BASE_PE_IMAGE_H_
-#define BASE_PE_IMAGE_H_
+#ifndef BASE_WIN_PE_IMAGE_H_
+#define BASE_WIN_PE_IMAGE_H_
 #pragma once
 
 #include <windows.h>
 #include <DelayIMP.h>
 
+namespace base {
+namespace win {
+
 // This class is a wrapper for the Portable Executable File Format (PE).
 // It's main purpose is to provide an easy way to work with imports and exports
 // from a file, mapped in memory as image.
@@ -255,4 +258,7 @@ inline PIMAGE_EXPORT_DIRECTORY PEImage::GetExportDirectory() const {
              GetImageDirectoryEntryAddr(IMAGE_DIRECTORY_ENTRY_EXPORT));
 }
 
-#endif  // BASE_PE_IMAGE_H_
+}  // namespace win
+}  // namespace base
+
+#endif  // BASE_WIN_PE_IMAGE_H_
diff --git a/base/pe_image_unittest.cc b/base/win/pe_image_unittest.cc
similarity index 98%
rename from base/pe_image_unittest.cc
rename to base/win/pe_image_unittest.cc
index 6d8875e21d6b4bba326991154e6b688ce644385e..899ce945e31bb2adab1d808afbeed7f21a72721e 100644
--- a/base/pe_image_unittest.cc
+++ b/base/win/pe_image_unittest.cc
@@ -5,9 +5,12 @@
 // This file contains unit tests for PEImage.
 
 #include "testing/gtest/include/gtest/gtest.h"
-#include "base/pe_image.h"
+#include "base/win/pe_image.h"
 #include "base/win/windows_version.h"
 
+namespace base {
+namespace win {
+
 // Just counts the number of invocations.
 bool ExportsCallback(const PEImage &image,
                      DWORD ordinal,
@@ -211,3 +214,6 @@ TEST(PEImageTest, RetrievesExports) {
 
   FreeLibrary(module);
 }
+
+}  // namespace win
+}  // namespace base
diff --git a/base/registry.cc b/base/win/registry.cc
similarity index 98%
rename from base/registry.cc
rename to base/win/registry.cc
index f8e58b94e15633033d873bffd9e4c55325fcaa97..545c337f946b11cd511a298edff637a4bb541358 100644
--- a/base/registry.cc
+++ b/base/win/registry.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "base/registry.h"
+#include "base/win/registry.h"
 
 #include <shlwapi.h>
 
@@ -10,6 +10,9 @@
 
 #pragma comment(lib, "shlwapi.lib")  // for SHDeleteKey
 
+namespace base {
+namespace win {
+
 RegistryValueIterator::RegistryValueIterator(HKEY root_key,
                                              const wchar_t* folder_key) {
   LONG result = RegOpenKeyEx(root_key, folder_key, 0, KEY_READ, &key_);
@@ -379,3 +382,6 @@ bool RegKey::HasChanged() {
   }
   return false;
 }
+
+}  // namespace win
+}  // namespace base
diff --git a/base/win/registry.h b/base/win/registry.h
new file mode 100644
index 0000000000000000000000000000000000000000..d1ef25b2cae7e22a6cdac90932146d41e8285fe8
--- /dev/null
+++ b/base/win/registry.h
@@ -0,0 +1,171 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_WIN_REGISTRY_H_
+#define BASE_WIN_REGISTRY_H_
+#pragma once
+
+#include <windows.h>
+#include <string>
+
+#include "base/basictypes.h"
+
+namespace base {
+namespace win {
+
+// Utility class to read, write and manipulate the Windows Registry.
+// Registry vocabulary primer: a "key" is like a folder, in which there
+// are "values", which are <name, data> pairs, with an associated data type.
+class RegKey {
+ public:
+  RegKey();
+  RegKey(HKEY rootkey, const wchar_t* subkey, REGSAM access);
+  ~RegKey();
+
+  bool Create(HKEY rootkey, const wchar_t* subkey, REGSAM access);
+
+  bool CreateWithDisposition(HKEY rootkey, const wchar_t* subkey,
+                             DWORD* disposition, REGSAM access);
+
+  bool Open(HKEY rootkey, const wchar_t* subkey, REGSAM access);
+
+  // Creates a subkey or open it if it already exists.
+  bool CreateKey(const wchar_t* name, REGSAM access);
+
+  // Opens a subkey
+  bool OpenKey(const wchar_t* name, REGSAM access);
+
+  void Close();
+
+  DWORD ValueCount();
+
+  // Determine the nth value's name.
+  bool ReadName(int index, std::wstring* name);
+
+  // True while the key is valid.
+  bool Valid() const { return key_ != NULL; }
+
+  // Kill a key and everything that live below it; please be careful when using
+  // it.
+  bool DeleteKey(const wchar_t* name);
+
+  // Deletes a single value within the key.
+  bool DeleteValue(const wchar_t* name);
+
+  bool ValueExists(const wchar_t* name);
+
+  bool ReadValue(const wchar_t* name, void* data, DWORD* dsize, DWORD* dtype);
+  bool ReadValue(const wchar_t* name, std::wstring* value);
+  bool ReadValueDW(const wchar_t* name, DWORD* value);
+
+  bool WriteValue(const wchar_t* name, const void* data, DWORD dsize,
+                  DWORD dtype);
+  bool WriteValue(const wchar_t* name, const wchar_t* value);
+  bool WriteValue(const wchar_t* name, DWORD value);
+
+  // Starts watching the key to see if any of its values have changed.
+  // The key must have been opened with the KEY_NOTIFY access privelege.
+  bool StartWatching();
+
+  // If StartWatching hasn't been called, always returns false.
+  // Otherwise, returns true if anything under the key has changed.
+  // This can't be const because the |watch_event_| may be refreshed.
+  bool HasChanged();
+
+  // Will automatically be called by destructor if not manually called
+  // beforehand.  Returns true if it was watching, false otherwise.
+  bool StopWatching();
+
+  inline bool IsWatching() const { return watch_event_ != 0; }
+  HANDLE watch_event() const { return watch_event_; }
+  HKEY Handle() const { return key_; }
+
+ private:
+  HKEY key_;  // The registry key being iterated.
+  HANDLE watch_event_;
+
+  DISALLOW_COPY_AND_ASSIGN(RegKey);
+};
+
+// Iterates the entries found in a particular folder on the registry.
+// For this application I happen to know I wont need data size larger
+// than MAX_PATH, but in real life this wouldn't neccessarily be
+// adequate.
+class RegistryValueIterator {
+ public:
+  RegistryValueIterator(HKEY root_key, const wchar_t* folder_key);
+
+  ~RegistryValueIterator();
+
+  DWORD ValueCount() const;
+
+  // True while the iterator is valid.
+  bool Valid() const;
+
+  // Advances to the next registry entry.
+  void operator++();
+
+  const wchar_t* Name() const { return name_; }
+  const wchar_t* Value() const { return value_; }
+  DWORD ValueSize() const { return value_size_; }
+  DWORD Type() const { return type_; }
+
+  int Index() const { return index_; }
+
+ private:
+  // Read in the current values.
+  bool Read();
+
+  // The registry key being iterated.
+  HKEY key_;
+
+  // Current index of the iteration.
+  int index_;
+
+  // Current values.
+  wchar_t name_[MAX_PATH];
+  wchar_t value_[MAX_PATH];
+  DWORD value_size_;
+  DWORD type_;
+
+  DISALLOW_COPY_AND_ASSIGN(RegistryValueIterator);
+};
+
+class RegistryKeyIterator {
+ public:
+  RegistryKeyIterator(HKEY root_key, const wchar_t* folder_key);
+
+  ~RegistryKeyIterator();
+
+  DWORD SubkeyCount() const;
+
+  // True while the iterator is valid.
+  bool Valid() const;
+
+  // Advances to the next entry in the folder.
+  void operator++();
+
+  const wchar_t* Name() const { return name_; }
+
+  int Index() const { return index_; }
+
+ private:
+  // Read in the current values.
+  bool Read();
+
+  // The registry key being iterated.
+  HKEY key_;
+
+  // Current index of the iteration.
+  int index_;
+
+  wchar_t name_[MAX_PATH];
+
+  DISALLOW_COPY_AND_ASSIGN(RegistryKeyIterator);
+};
+
+}  // namespace win
+}  // namespace base
+
+#endif  // BASE_WIN_REGISTRY_H_
diff --git a/base/registry_unittest.cc b/base/win/registry_unittest.cc
similarity index 93%
rename from base/registry_unittest.cc
rename to base/win/registry_unittest.cc
index 2618a75be1b90e29d1169df832f0b9f572c608e0..524612aa0f248519ef907b3385ae00da90093165 100644
--- a/base/registry_unittest.cc
+++ b/base/win/registry_unittest.cc
@@ -2,9 +2,12 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "base/registry.h"
+#include "base/win/registry.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
+namespace base {
+namespace win {
+
 namespace {
 
 const wchar_t kRootKey[] = L"Base_Registry_Unittest";
@@ -57,3 +60,6 @@ TEST_F(RegistryTest, ValueTest) {
 }
 
 }  // namespace
+
+}  // namespace win
+}  // namespace base
diff --git a/base/win_util.cc b/base/win_util.cc
index 70d28299fa762b11756dd86766d3333d21806e3e..a57612238c5df7973a5417011b4af25a846c5729 100644
--- a/base/win_util.cc
+++ b/base/win_util.cc
@@ -12,7 +12,7 @@
 #include <shlobj.h>
 
 #include "base/logging.h"
-#include "base/registry.h"
+#include "base/win/registry.h"
 #include "base/scoped_handle.h"
 #include "base/scoped_ptr.h"
 #include "base/string_util.h"
@@ -127,7 +127,7 @@ std::wstring GetClassName(HWND window) {
 }
 
 bool UserAccountControlIsEnabled() {
-  RegKey key(HKEY_LOCAL_MACHINE,
+  base::win::RegKey key(HKEY_LOCAL_MACHINE,
       L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System",
       KEY_READ);
   DWORD uac_enabled;
@@ -187,12 +187,12 @@ static const char16 kAutoRunKeyPath[] =
 
 bool AddCommandToAutoRun(HKEY root_key, const string16& name,
                          const string16& command) {
-  RegKey autorun_key(root_key, kAutoRunKeyPath, KEY_SET_VALUE);
+  base::win::RegKey autorun_key(root_key, kAutoRunKeyPath, KEY_SET_VALUE);
   return autorun_key.WriteValue(name.c_str(), command.c_str());
 }
 
 bool RemoveCommandFromAutoRun(HKEY root_key, const string16& name) {
-  RegKey autorun_key(root_key, kAutoRunKeyPath, KEY_SET_VALUE);
+  base::win::RegKey autorun_key(root_key, kAutoRunKeyPath, KEY_SET_VALUE);
   return autorun_key.DeleteValue(name.c_str());
 }
 
diff --git a/base/windows_message_list.h b/base/windows_message_list.h
deleted file mode 100644
index 3452babe43bbcee5bd4f2420e483658813d469d8..0000000000000000000000000000000000000000
--- a/base/windows_message_list.h
+++ /dev/null
@@ -1,249 +0,0 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// WARNING: DO NOT USE standard header file protection.
-// This file may be include several times in its entirety.
-
-// This file contains a list of all messages supported by Windows as would be
-// handled in a message loop.  We only list the messages provided in
-// <winuser.h>, and do not currently include (the otherwise undefined)
-// #define WM_SYSTIMER 0x118
-
-// By using various macro tricks, this list can be used to create pretty print
-// functions for the messages.  See message_loop.cc for an example.
-
-// Start list of Windows Messages given in <winuser.h>
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NULL)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_CREATE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_DESTROY)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MOVE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_SIZE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_ACTIVATE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_SETFOCUS)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_KILLFOCUS)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_ENABLE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_SETREDRAW)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_SETTEXT)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_GETTEXT)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_GETTEXTLENGTH)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_PAINT)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_CLOSE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_QUERYENDSESSION)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_QUERYOPEN)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_ENDSESSION)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_QUIT)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_ERASEBKGND)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_SYSCOLORCHANGE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_SHOWWINDOW)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_WININICHANGE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_SETTINGCHANGE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_DEVMODECHANGE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_ACTIVATEAPP)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_FONTCHANGE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_TIMECHANGE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_CANCELMODE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_SETCURSOR)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MOUSEACTIVATE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_CHILDACTIVATE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_QUEUESYNC)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_GETMINMAXINFO)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_PAINTICON)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_ICONERASEBKGND)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NEXTDLGCTL)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_SPOOLERSTATUS)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_DRAWITEM)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MEASUREITEM)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_DELETEITEM)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_VKEYTOITEM)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_CHARTOITEM)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_SETFONT)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_GETFONT)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_SETHOTKEY)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_GETHOTKEY)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_QUERYDRAGICON)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_COMPAREITEM)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_GETOBJECT)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_COMPACTING)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_COMMNOTIFY)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_WINDOWPOSCHANGING)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_WINDOWPOSCHANGED)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_POWER)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_COPYDATA)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_CANCELJOURNAL)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NOTIFY)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_INPUTLANGCHANGEREQUEST)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_INPUTLANGCHANGE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_TCARD)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_HELP)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_USERCHANGED)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NOTIFYFORMAT)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_CONTEXTMENU)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_STYLECHANGING)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_STYLECHANGED)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_DISPLAYCHANGE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_GETICON)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_SETICON)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NCCREATE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NCDESTROY)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NCCALCSIZE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NCHITTEST)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NCPAINT)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NCACTIVATE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_GETDLGCODE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_SYNCPAINT)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NCMOUSEMOVE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NCLBUTTONDOWN)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NCLBUTTONUP)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NCLBUTTONDBLCLK)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NCRBUTTONDOWN)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NCRBUTTONUP)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NCRBUTTONDBLCLK)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NCMBUTTONDOWN)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NCMBUTTONUP)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NCMBUTTONDBLCLK)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NCXBUTTONDOWN)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NCXBUTTONUP)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NCXBUTTONDBLCLK)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_INPUT_DEVICE_CHANGE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_INPUT)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_KEYFIRST)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_KEYDOWN)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_KEYUP)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_CHAR)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_DEADCHAR)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_SYSKEYDOWN)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_SYSKEYUP)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_SYSCHAR)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_SYSDEADCHAR)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_UNICHAR)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_KEYLAST)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_KEYLAST)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_IME_STARTCOMPOSITION)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_IME_ENDCOMPOSITION)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_IME_COMPOSITION)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_IME_KEYLAST)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_INITDIALOG)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_COMMAND)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_SYSCOMMAND)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_TIMER)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_HSCROLL)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_VSCROLL)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_INITMENU)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_INITMENUPOPUP)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MENUSELECT)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MENUCHAR)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_ENTERIDLE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MENURBUTTONUP)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MENUDRAG)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MENUGETOBJECT)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_UNINITMENUPOPUP)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MENUCOMMAND)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_CHANGEUISTATE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_UPDATEUISTATE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_QUERYUISTATE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_CTLCOLORMSGBOX)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_CTLCOLOREDIT)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_CTLCOLORLISTBOX)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_CTLCOLORBTN)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_CTLCOLORDLG)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_CTLCOLORSCROLLBAR)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_CTLCOLORSTATIC)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MOUSEFIRST)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MOUSEMOVE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_LBUTTONDOWN)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_LBUTTONUP)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_LBUTTONDBLCLK)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_RBUTTONDOWN)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_RBUTTONUP)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_RBUTTONDBLCLK)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MBUTTONDOWN)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MBUTTONUP)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MBUTTONDBLCLK)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MOUSEWHEEL)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_XBUTTONDOWN)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_XBUTTONUP)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_XBUTTONDBLCLK)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MOUSEHWHEEL)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MOUSELAST)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MOUSELAST)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MOUSELAST)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MOUSELAST)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_PARENTNOTIFY)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_ENTERMENULOOP)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_EXITMENULOOP)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NEXTMENU)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_SIZING)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_CAPTURECHANGED)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MOVING)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_POWERBROADCAST)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_DEVICECHANGE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MDICREATE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MDIDESTROY)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MDIACTIVATE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MDIRESTORE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MDINEXT)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MDIMAXIMIZE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MDITILE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MDICASCADE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MDIICONARRANGE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MDIGETACTIVE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MDISETMENU)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_ENTERSIZEMOVE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_EXITSIZEMOVE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_DROPFILES)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MDIREFRESHMENU)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_IME_SETCONTEXT)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_IME_NOTIFY)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_IME_CONTROL)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_IME_COMPOSITIONFULL)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_IME_SELECT)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_IME_CHAR)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_IME_REQUEST)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_IME_KEYDOWN)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_IME_KEYUP)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MOUSEHOVER)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_MOUSELEAVE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NCMOUSEHOVER)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_NCMOUSELEAVE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_WTSSESSION_CHANGE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_TABLET_FIRST)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_TABLET_LAST)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_CUT)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_COPY)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_PASTE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_CLEAR)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_UNDO)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_RENDERFORMAT)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_RENDERALLFORMATS)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_DESTROYCLIPBOARD)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_DRAWCLIPBOARD)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_PAINTCLIPBOARD)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_VSCROLLCLIPBOARD)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_SIZECLIPBOARD)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_ASKCBFORMATNAME)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_CHANGECBCHAIN)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_HSCROLLCLIPBOARD)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_QUERYNEWPALETTE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_PALETTEISCHANGING)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_PALETTECHANGED)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_HOTKEY)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_PRINT)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_PRINTCLIENT)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_APPCOMMAND)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_THEMECHANGED)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_CLIPBOARDUPDATE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_DWMCOMPOSITIONCHANGED)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_DWMNCRENDERINGCHANGED)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_DWMCOLORIZATIONCOLORCHANGED)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_DWMWINDOWMAXIMIZEDCHANGE)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_GETTITLEBARINFOEX)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_HANDHELDFIRST)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_HANDHELDLAST)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_AFXFIRST)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_AFXLAST)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_PENWINFIRST)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_PENWINLAST)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_APP)
-A_NAMED_MESSAGE_FROM_WINUSER_H(WM_USER)
-// End list of Windows Messages given in <winuser.h>
diff --git a/chrome/app/breakpad_win.cc b/chrome/app/breakpad_win.cc
index 3f4f86208ebfab17660d4d80af68a4a14e0b0de6..308678e59b8df8482a4acf3d9025861b2b1f53dc 100644
--- a/chrome/app/breakpad_win.cc
+++ b/chrome/app/breakpad_win.cc
@@ -16,12 +16,12 @@
 #include "base/environment.h"
 #include "base/file_util.h"
 #include "base/file_version_info.h"
-#include "base/registry.h"
 #include "base/scoped_ptr.h"
 #include "base/string_split.h"
 #include "base/string_util.h"
 #include "base/utf_string_conversions.h"
 #include "base/win_util.h"
+#include "base/win/registry.h"
 #include "breakpad/src/client/windows/handler/exception_handler.h"
 #include "chrome/app/hard_error_handler_win.h"
 #include "chrome/common/child_process_logging.h"
@@ -432,13 +432,15 @@ bool ShowRestartDialogIfCrashed(bool* exit_now) {
 static bool MetricsReportingControlledByPolicy(bool* result) {
   std::wstring key_name = UTF8ToWide(policy::key::kMetricsReportingEnabled);
   DWORD value;
-  RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE, policy::kRegistrySubKey, KEY_READ);
+  base::win::RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE,
+                                    policy::kRegistrySubKey, KEY_READ);
   if (hkcu_policy_key.ReadValueDW(key_name.c_str(), &value)) {
     *result = value != 0;
     return true;
   }
 
-  RegKey hklm_policy_key(HKEY_CURRENT_USER, policy::kRegistrySubKey, KEY_READ);
+  base::win::RegKey hklm_policy_key(HKEY_CURRENT_USER,
+                                    policy::kRegistrySubKey, KEY_READ);
   if (hklm_policy_key.ReadValueDW(key_name.c_str(), &value)) {
     *result = value != 0;
     return true;
diff --git a/chrome/browser/autofill/autofill_ie_toolbar_import_win.cc b/chrome/browser/autofill/autofill_ie_toolbar_import_win.cc
index de151e3c3610c37cc89bd3aead6a4da21133b714..dcfe0a5dcdc4bcab688104d9075f122cafd091fd 100644
--- a/chrome/browser/autofill/autofill_ie_toolbar_import_win.cc
+++ b/chrome/browser/autofill/autofill_ie_toolbar_import_win.cc
@@ -5,14 +5,16 @@
 #include "chrome/browser/autofill/autofill_ie_toolbar_import_win.h"
 
 #include "base/basictypes.h"
-#include "base/registry.h"
 #include "base/string16.h"
+#include "base/win/registry.h"
 #include "chrome/browser/autofill/autofill_profile.h"
 #include "chrome/browser/autofill/credit_card.h"
 #include "chrome/browser/autofill/field_types.h"
 #include "chrome/browser/autofill/personal_data_manager.h"
 #include "chrome/browser/sync/util/data_encryption.h"
 
+using base::win::RegKey;
+
 // Forward declaration. This function is not in unnamed namespace as it
 // is referenced in the unittest.
 bool ImportCurrentUserProfiles(std::vector<AutoFillProfile>* profiles,
@@ -177,7 +179,8 @@ bool ImportCurrentUserProfiles(std::vector<AutoFillProfile>* profiles,
         profile_reg_values[i].field_type;
   }
 
-  RegistryKeyIterator iterator_profiles(HKEY_CURRENT_USER, kProfileKey);
+  base::win::RegistryKeyIterator iterator_profiles(HKEY_CURRENT_USER,
+                                                   kProfileKey);
   for (; iterator_profiles.Valid(); ++iterator_profiles) {
     std::wstring key_name(kProfileKey);
     key_name.append(L"\\");
@@ -208,7 +211,8 @@ bool ImportCurrentUserProfiles(std::vector<AutoFillProfile>* profiles,
 
   // We import CC profiles only if they are not password protected.
   if (password_hash.empty() && IsEmptySalt(salt)) {
-    RegistryKeyIterator iterator_cc(HKEY_CURRENT_USER, kCreditCardKey);
+    base::win::RegistryKeyIterator iterator_cc(HKEY_CURRENT_USER,
+                                               kCreditCardKey);
     for (; iterator_cc.Valid(); ++iterator_cc) {
       std::wstring key_name(kCreditCardKey);
       key_name.append(L"\\");
diff --git a/chrome/browser/autofill/autofill_ie_toolbar_import_win_unittest.cc b/chrome/browser/autofill/autofill_ie_toolbar_import_win_unittest.cc
index 9aa76496ef6ea642d8e4ebaa13c060cde28d0ba9..05121394dd159f52691263c2e9ceca87dea5a76a 100644
--- a/chrome/browser/autofill/autofill_ie_toolbar_import_win_unittest.cc
+++ b/chrome/browser/autofill/autofill_ie_toolbar_import_win_unittest.cc
@@ -5,14 +5,16 @@
 #include "chrome/browser/autofill/autofill_ie_toolbar_import_win.h"
 
 #include "base/basictypes.h"
-#include "base/registry.h"
 #include "base/string16.h"
+#include "base/win/registry.h"
 #include "chrome/browser/autofill/autofill_profile.h"
 #include "chrome/browser/autofill/credit_card.h"
 #include "chrome/browser/autofill/field_types.h"
 #include "chrome/browser/sync/util/data_encryption.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
+using base::win::RegKey;
+
 // Defined in autofill_ie_toolbar_import_win.cc. Not exposed in the header file.
 bool ImportCurrentUserProfiles(std::vector<AutoFillProfile>* profiles,
                                std::vector<CreditCard>* credit_cards);
diff --git a/chrome/browser/background_mode_manager.cc b/chrome/browser/background_mode_manager.cc
index ef16b49e3fe86b5fbe917a635fc14f2a95c4196b..080e3b223249b554e4fa4850d3eddd9d55e64c0a 100644
--- a/chrome/browser/background_mode_manager.cc
+++ b/chrome/browser/background_mode_manager.cc
@@ -53,7 +53,7 @@ static const char kXdgConfigHome[] = "XDG_CONFIG_HOME";
 #endif
 
 #if defined(OS_WIN)
-#include "base/registry.h"
+#include "base/win/registry.h"
 const HKEY kBackgroundModeRegistryRootKey = HKEY_CURRENT_USER;
 const wchar_t* kBackgroundModeRegistrySubkey =
     L"Software\\Microsoft\\Windows\\CurrentVersion\\Run";
@@ -401,10 +401,10 @@ void BackgroundModeManager::EnableLaunchOnStartup(bool should_launch) {
   // TODO(rickcam): Bug 53597: Make RegKey mockable.
   // TODO(rickcam): Bug 53600: Use distinct registry keys per flavor+profile.
   const wchar_t* key_name = kBackgroundModeRegistryKeyName;
-  RegKey read_key(kBackgroundModeRegistryRootKey,
-                  kBackgroundModeRegistrySubkey, KEY_READ);
-  RegKey write_key(kBackgroundModeRegistryRootKey,
-                   kBackgroundModeRegistrySubkey, KEY_WRITE);
+  base::win::RegKey read_key(kBackgroundModeRegistryRootKey,
+                             kBackgroundModeRegistrySubkey, KEY_READ);
+  base::win::RegKey write_key(kBackgroundModeRegistryRootKey,
+                              kBackgroundModeRegistrySubkey, KEY_WRITE);
   if (should_launch) {
     FilePath executable;
     if (!PathService::Get(base::FILE_EXE, &executable))
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index 43609095ef8315375fb598f26eff6f9e99d0f03c..73f31c41a290fb628e13cf79b1a974c07e3c5310 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -72,8 +72,7 @@
 #include "app/os_exchange_data_provider_win.h"
 #include "app/win_util.h"
 #include "base/base_drag_source.h"
-#include "base/registry.h"
-#include "base/scoped_comptr_win.h"
+#include "base/win/scoped_comptr.h"
 #include "base/win_util.h"
 #include "chrome/browser/browser_list.h"
 #include "chrome/browser/views/frame/browser_view.h"
@@ -602,7 +601,7 @@ void UpdateAppIconDownloadProgress(int download_count,
   if (base::win::GetVersion() < base::win::VERSION_WIN7)
     return;
 
-  ScopedComPtr<ITaskbarList3> taskbar;
+  base::win::ScopedComPtr<ITaskbarList3> taskbar;
   HRESULT result = taskbar.CreateInstance(CLSID_TaskbarList, NULL,
                                           CLSCTX_INPROC_SERVER);
   if (FAILED(result)) {
diff --git a/chrome/browser/extensions/extension_rlz_apitest.cc b/chrome/browser/extensions/extension_rlz_apitest.cc
index ce97ae0fb406a0c0ce1a9fe1d6115a24d631bb23..10bfba66c93d025e2275148c3214d20bfdce577a 100644
--- a/chrome/browser/extensions/extension_rlz_apitest.cc
+++ b/chrome/browser/extensions/extension_rlz_apitest.cc
@@ -4,7 +4,7 @@
 
 #include <map>
 
-#include "base/registry.h"
+#include "base/win/registry.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/extensions/extension_function.h"
 #include "chrome/browser/extensions/extension_function_dispatcher.h"
@@ -51,8 +51,9 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Rlz) {
   rlz_lib::ClearProductState(rlz_lib::DESKTOP, access_points);
 
   // Check that the state has really been cleared.
-  RegKey key(HKEY_CURRENT_USER, L"Software\\Google\\Common\\Rlz\\Events\\N",
-             KEY_READ);
+  base::win::RegKey key(HKEY_CURRENT_USER,
+                        L"Software\\Google\\Common\\Rlz\\Events\\N",
+                        KEY_READ);
   ASSERT_FALSE(key.Valid());
 
   key.Open(HKEY_CURRENT_USER, L"Software\\Google\\Common\\Rlz\\Events\\D",
diff --git a/chrome/browser/extensions/external_registry_extension_provider_win.cc b/chrome/browser/extensions/external_registry_extension_provider_win.cc
index c18aaa772fc0fe12dadfe188cc8abe8b95b30f12..02ae85068f98ce9f4162d66aa6a660240a5a3c1c 100644
--- a/chrome/browser/extensions/external_registry_extension_provider_win.cc
+++ b/chrome/browser/extensions/external_registry_extension_provider_win.cc
@@ -1,14 +1,14 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
 #include "chrome/browser/extensions/external_registry_extension_provider_win.h"
 
 #include "base/file_path.h"
-#include "base/registry.h"
 #include "base/string_util.h"
 #include "base/utf_string_conversions.h"
 #include "base/version.h"
+#include "base/win/registry.h"
 
 // The Registry hive where to look for external extensions.
 const HKEY kRegRoot = HKEY_LOCAL_MACHINE;
@@ -30,10 +30,10 @@ ExternalRegistryExtensionProvider::~ExternalRegistryExtensionProvider() {
 
 void ExternalRegistryExtensionProvider::VisitRegisteredExtension(
     Visitor* visitor, const std::set<std::string>& ids_to_ignore) const {
-  RegistryKeyIterator iterator(kRegRoot,
-                               ASCIIToWide(kRegistryExtensions).c_str());
+  base::win::RegistryKeyIterator iterator(
+      kRegRoot, ASCIIToWide(kRegistryExtensions).c_str());
   while (iterator.Valid()) {
-    RegKey key;
+    base::win::RegKey key;
     std::wstring key_path = ASCIIToWide(kRegistryExtensions);
     key_path.append(L"\\");
     key_path.append(iterator.Name());
@@ -78,7 +78,7 @@ void ExternalRegistryExtensionProvider::VisitRegisteredExtension(
 Version* ExternalRegistryExtensionProvider::RegisteredVersion(
     const std::string& id,
     Extension::Location* location) const  {
-  RegKey key;
+  base::win::RegKey key;
   std::wstring key_path = ASCIIToWide(kRegistryExtensions);
   key_path.append(L"\\");
   key_path.append(ASCIIToWide(id));
diff --git a/chrome/browser/first_run/first_run_win.cc b/chrome/browser/first_run/first_run_win.cc
index df3f46d26a80228c7dacc4bc47d4f1c06795d23e..4f9175dc860c66fa3f13c21b235c38f8c92a83f4 100644
--- a/chrome/browser/first_run/first_run_win.cc
+++ b/chrome/browser/first_run/first_run_win.cc
@@ -18,12 +18,12 @@
 #include "base/file_util.h"
 #include "base/object_watcher.h"
 #include "base/path_service.h"
-#include "base/registry.h"
 #include "base/scoped_comptr_win.h"
 #include "base/scoped_ptr.h"
 #include "base/string_number_conversions.h"
 #include "base/string_split.h"
 #include "base/utf_string_conversions.h"
+#include "base/win/registry.h"
 #include "base/win/windows_version.h"
 #include "chrome/browser/extensions/extensions_service.h"
 #include "chrome/browser/extensions/extension_updater.h"
@@ -280,7 +280,7 @@ bool Upgrade::SwapNewChromeExeIfPresent() {
   bool user_install = InstallUtil::IsPerUserInstall(curr_chrome_exe.c_str());
   HKEY reg_root = user_install ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE;
   BrowserDistribution *dist = BrowserDistribution::GetDistribution();
-  RegKey key;
+  base::win::RegKey key;
   std::wstring rename_cmd;
   if (key.Open(reg_root, dist->GetVersionKey().c_str(), KEY_READ) &&
       key.ReadValue(google_update::kRegRenameCmdField, &rename_cmd)) {
diff --git a/chrome/browser/history/history_publisher_win.cc b/chrome/browser/history/history_publisher_win.cc
index 3a7a548b22740264c209834e300805e4344a2d7a..39ef5218a4e63c5ed0cacf062592b6b28e82877c 100644
--- a/chrome/browser/history/history_publisher_win.cc
+++ b/chrome/browser/history/history_publisher_win.cc
@@ -9,13 +9,13 @@
 #include <oleauto.h>
 #include <wtypes.h>
 
-#include "base/registry.h"
 #include "base/scoped_bstr_win.h"
 #include "base/scoped_comptr_win.h"
 #include "base/scoped_variant_win.h"
 #include "base/string_util.h"
 #include "base/time.h"
 #include "base/utf_string_conversions.h"
+#include "base/win/registry.h"
 #include "googleurl/src/gurl.h"
 
 namespace {
@@ -42,7 +42,7 @@ bool CoCreateIndexerFromName(const wchar_t* name,
 void AddRegisteredIndexers(HKEY root, const wchar_t* path,
     std::vector< ScopedComPtr<IChromeHistoryIndexer> >* indexers) {
   IChromeHistoryIndexer* indexer;
-  RegistryKeyIterator r_iter(root, path);
+  base::win::RegistryKeyIterator r_iter(root, path);
   while (r_iter.Valid()) {
     if (CoCreateIndexerFromName(r_iter.Name(), &indexer)) {
       indexers->push_back(ScopedComPtr<IChromeHistoryIndexer>(indexer));
diff --git a/chrome/browser/importer/firefox_importer_utils_win.cc b/chrome/browser/importer/firefox_importer_utils_win.cc
index 3200eb14ff8120b20f6acafd3f100dbbcd9ca781..7fc2a419576c470a1c4a801aa51fcb331b956cde 100644
--- a/chrome/browser/importer/firefox_importer_utils_win.cc
+++ b/chrome/browser/importer/firefox_importer_utils_win.cc
@@ -7,7 +7,7 @@
 #include <shlobj.h>
 
 #include "base/file_util.h"
-#include "base/registry.h"
+#include "base/win/registry.h"
 
 // NOTE: Keep these in order since we need test all those paths according
 // to priority. For example. One machine has multiple users. One non-admin
@@ -28,8 +28,8 @@ int GetCurrentFirefoxMajorVersionFromRegistry() {
   // written under HKLM\Mozilla. Otherwise it the keys will be written under
   // HKCU\Mozilla.
   for (int i = 0; i < arraysize(kFireFoxRegistryPaths); ++i) {
-    RegKey reg_key(kFireFoxRegistryPaths[i],
-                   L"Software\\Mozilla\\Mozilla Firefox", KEY_READ);
+    base::win::RegKey reg_key(kFireFoxRegistryPaths[i],
+                              L"Software\\Mozilla\\Mozilla Firefox", KEY_READ);
 
     bool result = reg_key.ReadValue(L"CurrentVersion", ver_buffer,
                                     &ver_buffer_length, NULL);
@@ -45,14 +45,16 @@ std::wstring GetFirefoxInstallPathFromRegistry() {
   std::wstring registry_path = L"Software\\Mozilla\\Mozilla Firefox";
   wchar_t buffer[MAX_PATH];
   DWORD buffer_length = sizeof(buffer);
-  RegKey reg_key(HKEY_LOCAL_MACHINE, registry_path.c_str(), KEY_READ);
+  base::win::RegKey reg_key(HKEY_LOCAL_MACHINE, registry_path.c_str(),
+                            KEY_READ);
   bool result = reg_key.ReadValue(L"CurrentVersion", buffer,
                                   &buffer_length, NULL);
   if (!result)
     return std::wstring();
   registry_path += L"\\" + std::wstring(buffer) + L"\\Main";
   buffer_length = sizeof(buffer);
-  RegKey reg_key_directory(HKEY_LOCAL_MACHINE, registry_path.c_str(), KEY_READ);
+  base::win::RegKey reg_key_directory(HKEY_LOCAL_MACHINE,
+                                      registry_path.c_str(), KEY_READ);
   result = reg_key_directory.ReadValue(L"Install Directory", buffer,
                                        &buffer_length, NULL);
   if (!result)
diff --git a/chrome/browser/importer/ie_importer.cc b/chrome/browser/importer/ie_importer.cc
index 2d6d319ad59d58a3df186a7b4a2d6ed3a9944fd4..07b2d343ce767c3efc526521b33454bf31e1dd98 100644
--- a/chrome/browser/importer/ie_importer.cc
+++ b/chrome/browser/importer/ie_importer.cc
@@ -19,13 +19,13 @@
 #include "app/win_util.h"
 #include "base/file_path.h"
 #include "base/file_util.h"
-#include "base/registry.h"
 #include "base/scoped_comptr_win.h"
 #include "base/string_split.h"
 #include "base/string_util.h"
 #include "base/time.h"
 #include "base/values.h"
 #include "base/utf_string_conversions.h"
+#include "base/win/registry.h"
 #include "base/win/windows_version.h"
 #include "chrome/browser/bookmarks/bookmark_model.h"
 #include "chrome/browser/importer/importer_bridge.h"
@@ -40,6 +40,8 @@
 #include "webkit/glue/password_form.h"
 
 using base::Time;
+using base::win::RegKey;
+using base::win::RegistryValueIterator;
 using webkit_glue::PasswordForm;
 
 namespace {
@@ -354,7 +356,8 @@ void IEImporter::ImportSearchEngines() {
   const TemplateURL* default_search_engine = NULL;
   std::map<std::string, TemplateURL*> search_engines_map;
   key.ReadValue(L"DefaultScope", &default_search_engine_name);
-  RegistryKeyIterator key_iterator(HKEY_CURRENT_USER, kSearchScopePath);
+  base::win::RegistryKeyIterator key_iterator(HKEY_CURRENT_USER,
+                                              kSearchScopePath);
   while (key_iterator.Valid()) {
     std::wstring sub_key_name = kSearchScopePath;
     sub_key_name.append(L"\\").append(key_iterator.Name());
diff --git a/chrome/browser/platform_util_win.cc b/chrome/browser/platform_util_win.cc
index a807a428a4a82f0b469205845b11532bb73fcffa..c20c9254c4c04533e4f7bb835d1dde9cca6da5cf 100644
--- a/chrome/browser/platform_util_win.cc
+++ b/chrome/browser/platform_util_win.cc
@@ -14,10 +14,10 @@
 #include "base/file_util.h"
 #include "base/path_service.h"
 #include "base/logging.h"
-#include "base/registry.h"
 #include "base/scoped_comptr_win.h"
 #include "base/string_util.h"
 #include "base/utf_string_conversions.h"
+#include "base/win/registry.h"
 #include "chrome/installer/util/google_update_settings.h"
 #include "chrome/installer/util/google_update_constants.h"
 #include "chrome/installer/util/install_util.h"
@@ -110,7 +110,7 @@ void OpenExternal(const GURL& url) {
     return;
   }
 
-  RegKey key;
+  base::win::RegKey key;
   std::wstring registry_path = ASCIIToWide(url.scheme()) +
                                L"\\shell\\open\\command";
   key.Open(HKEY_CLASSES_ROOT, registry_path.c_str(), KEY_READ);
diff --git a/chrome/browser/plugin_service.h b/chrome/browser/plugin_service.h
index 9ff7988d9375f2f88d85b76c6d4e7259f2f64c3a..abb55a1680a65e4cb793040ad1e509a435818e84 100644
--- a/chrome/browser/plugin_service.h
+++ b/chrome/browser/plugin_service.h
@@ -21,8 +21,8 @@
 #include "googleurl/src/gurl.h"
 
 #if defined(OS_WIN)
-#include "base/registry.h"
 #include "base/scoped_ptr.h"
+#include "base/win/registry.h"
 #endif
 
 #if defined(OS_CHROMEOS)
@@ -168,8 +168,8 @@ class PluginService
 
 #if defined(OS_WIN)
   // Registry keys for getting notifications when new plugins are installed.
-  RegKey hkcu_key_;
-  RegKey hklm_key_;
+  base::win::RegKey hkcu_key_;
+  base::win::RegKey hklm_key_;
   scoped_ptr<base::WaitableEvent> hkcu_event_;
   scoped_ptr<base::WaitableEvent> hklm_event_;
   base::WaitableEventWatcher hkcu_watcher_;
diff --git a/chrome/browser/policy/configuration_policy_provider_win.cc b/chrome/browser/policy/configuration_policy_provider_win.cc
index 18edc88aff9ced556047d3f6d38eac2448f50c89..c1ae370548aac8ed8551c18d58d8d97ccb79c3ab 100644
--- a/chrome/browser/policy/configuration_policy_provider_win.cc
+++ b/chrome/browser/policy/configuration_policy_provider_win.cc
@@ -10,7 +10,6 @@
 
 #include "base/logging.h"
 #include "base/object_watcher.h"
-#include "base/registry.h"
 #include "base/scoped_ptr.h"
 #include "base/string_number_conversions.h"
 #include "base/string_piece.h"
@@ -18,10 +17,39 @@
 #include "base/sys_string_conversions.h"
 #include "base/utf_string_conversions.h"
 #include "base/values.h"
+#include "base/win/registry.h"
 #include "chrome/common/policy_constants.h"
 
+using base::win::RegKey;
+
 namespace policy {
 
+namespace {
+
+bool ReadRegistryStringValue(RegKey* key, const string16& name,
+                             string16* result) {
+  DWORD value_size = 0;
+  DWORD key_type = 0;
+  scoped_array<uint8> buffer;
+
+  if (!key->ReadValue(name.c_str(), 0, &value_size, &key_type))
+    return false;
+  if (key_type != REG_SZ)
+    return false;
+
+  // According to the Microsoft documentation, the string
+  // buffer may not be explicitly 0-terminated. Allocate a
+  // slightly larger buffer and pre-fill to zeros to guarantee
+  // the 0-termination.
+  buffer.reset(new uint8[value_size + 2]);
+  memset(buffer.get(), 0, value_size + 2);
+  key->ReadValue(name.c_str(), buffer.get(), &value_size, NULL);
+  result->assign(reinterpret_cast<const wchar_t*>(buffer.get()));
+  return true;
+}
+
+}  // namespace
+
 // Period at which to run the reload task in case the group policy change
 // watchers fail.
 const int kReloadIntervalMinutes = 15;
@@ -155,28 +183,6 @@ bool ConfigurationPolicyProviderWin::GetRegistryPolicyString(
   return ReadRegistryStringValue(&policy_key, name, result);
 }
 
-bool ConfigurationPolicyProviderWin::ReadRegistryStringValue(
-    RegKey* key, const string16& name, string16* result) {
-  DWORD value_size = 0;
-  DWORD key_type = 0;
-  scoped_array<uint8> buffer;
-
-  if (!key->ReadValue(name.c_str(), 0, &value_size, &key_type))
-    return false;
-  if (key_type != REG_SZ)
-    return false;
-
-  // According to the Microsoft documentation, the string
-  // buffer may not be explicitly 0-terminated. Allocate a
-  // slightly larger buffer and pre-fill to zeros to guarantee
-  // the 0-termination.
-  buffer.reset(new uint8[value_size + 2]);
-  memset(buffer.get(), 0, value_size + 2);
-  key->ReadValue(name.c_str(), buffer.get(), &value_size, NULL);
-  result->assign(reinterpret_cast<const wchar_t*>(buffer.get()));
-  return true;
-}
-
 bool ConfigurationPolicyProviderWin::GetRegistryPolicyStringList(
     const string16& key, ListValue* result) {
   string16 path = string16(kRegistrySubKey);
diff --git a/chrome/browser/policy/configuration_policy_provider_win.h b/chrome/browser/policy/configuration_policy_provider_win.h
index e0d797fc3df7cb1fc06384a896b1a6eb598c25d3..26bc3e640258421d95fbf9eac8bc8331663ade2f 100644
--- a/chrome/browser/policy/configuration_policy_provider_win.h
+++ b/chrome/browser/policy/configuration_policy_provider_win.h
@@ -14,7 +14,11 @@
 #include "chrome/browser/policy/configuration_policy_store.h"
 #include "chrome/browser/policy/configuration_policy_provider.h"
 
+namespace base {
+namespace win {
 class RegKey;
+}  // namespace win
+}  // namespace base
 
 namespace policy {
 
@@ -99,8 +103,6 @@ class ConfigurationPolicyProviderWin
 
   // Reads a string registry value |name| at the specified |key| and puts the
   // resulting string in |result|.
-  bool ReadRegistryStringValue(RegKey* key, const string16& name,
-                               string16* result);
 
   bool GetRegistryPolicyString(const string16& name, string16* result);
   // Gets a list value contained under |key| one level below the policy root.
diff --git a/chrome/browser/policy/configuration_policy_provider_win_unittest.cc b/chrome/browser/policy/configuration_policy_provider_win_unittest.cc
index 0dac8188cbc06bcbd92ec5a4716ae3eb9a1c8946..f7a3524c94c2b539489a1d6b98016769eea6996b 100644
--- a/chrome/browser/policy/configuration_policy_provider_win_unittest.cc
+++ b/chrome/browser/policy/configuration_policy_provider_win_unittest.cc
@@ -6,12 +6,12 @@
 
 #include <windows.h>
 
-#include "base/registry.h"
 #include "base/scoped_ptr.h"
 #include "base/stl_util-inl.h"
 #include "base/string_number_conversions.h"
 #include "base/string_piece.h"
 #include "base/utf_string_conversions.h"
+#include "base/win/registry.h"
 #include "chrome/browser/policy/configuration_policy_pref_store.h"
 #include "chrome/browser/policy/configuration_policy_provider_win.h"
 #include "chrome/browser/policy/mock_configuration_policy_store.h"
@@ -19,6 +19,8 @@
 #include "chrome/common/pref_names.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
+using base::win::RegKey;
+
 namespace policy {
 
 const wchar_t kUnitTestRegistrySubKey[] = L"SOFTWARE\\Chromium Unit Tests";
diff --git a/chrome/browser/rlz/rlz_unittest.cc b/chrome/browser/rlz/rlz_unittest.cc
index 8680de6526e11e854aea5a1b08f72f7f99aa753c..f2ca69f8e8ff662d35cc12a5e4e4333b3cd008ba 100644
--- a/chrome/browser/rlz/rlz_unittest.cc
+++ b/chrome/browser/rlz/rlz_unittest.cc
@@ -4,11 +4,14 @@
 
 #include "chrome/browser/rlz/rlz.h"
 
-#include "base/registry.h"
 #include "base/path_service.h"
+#include "base/win/registry.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
+using base::win::RegKey;
+
 namespace {
+
 // Gets rid of registry leftovers from testing. Returns false if there
 // is nothing to clean.
 bool CleanValue(const wchar_t* key_name, const wchar_t* value) {
diff --git a/chrome/browser/shell_integration_win.cc b/chrome/browser/shell_integration_win.cc
index 98e672911d4021d1023a8cb93b9c9d8047ee2cef..2d53d288d87dbb63848a6fcb46ddac629cacfb18 100644
--- a/chrome/browser/shell_integration_win.cc
+++ b/chrome/browser/shell_integration_win.cc
@@ -13,12 +13,12 @@
 #include "base/file_util.h"
 #include "base/message_loop.h"
 #include "base/path_service.h"
-#include "base/registry.h"
 #include "base/scoped_comptr_win.h"
 #include "base/string_util.h"
 #include "base/task.h"
 #include "base/utf_string_conversions.h"
 #include "base/win_util.h"
+#include "base/win/registry.h"
 #include "base/win/windows_version.h"
 #include "chrome/browser/browser_thread.h"
 #include "chrome/browser/web_applications/web_app.h"
@@ -340,7 +340,7 @@ ShellIntegration::DefaultBrowserState ShellIntegration::IsDefaultBrowser() {
       HKEY root_key = HKEY_CLASSES_ROOT;
       // Check <protocol>\shell\open\command
       std::wstring key_path(kChromeProtocols[i] + ShellUtil::kRegShellOpen);
-      RegKey key(root_key, key_path.c_str(), KEY_READ);
+      base::win::RegKey key(root_key, key_path.c_str(), KEY_READ);
       std::wstring value;
       if (!key.Valid() || !key.ReadValue(L"", &value))
         return NOT_DEFAULT_BROWSER;
@@ -371,14 +371,15 @@ bool ShellIntegration::IsFirefoxDefaultBrowser() {
   bool ff_default = false;
   if (base::win::GetVersion() >= base::win::VERSION_VISTA) {
     std::wstring app_cmd;
-    RegKey key(HKEY_CURRENT_USER, ShellUtil::kRegVistaUrlPrefs, KEY_READ);
+    base::win::RegKey key(HKEY_CURRENT_USER,
+                          ShellUtil::kRegVistaUrlPrefs, KEY_READ);
     if (key.Valid() && key.ReadValue(L"Progid", &app_cmd) &&
         app_cmd == L"FirefoxURL")
       ff_default = true;
   } else {
     std::wstring key_path(L"http");
     key_path.append(ShellUtil::kRegShellOpen);
-    RegKey key(HKEY_CLASSES_ROOT, key_path.c_str(), KEY_READ);
+    base::win::RegKey key(HKEY_CLASSES_ROOT, key_path.c_str(), KEY_READ);
     std::wstring app_cmd;
     if (key.Valid() && key.ReadValue(L"", &app_cmd) &&
         std::wstring::npos != StringToLowerASCII(app_cmd).find(L"firefox"))
diff --git a/chrome/browser/views/external_protocol_dialog.cc b/chrome/browser/views/external_protocol_dialog.cc
index 6dda2e3a04779d2f605ea1fcf237ce605c9bc2bc..3022c2817b68763810d66fba79d25d5ae45843e9 100644
--- a/chrome/browser/views/external_protocol_dialog.cc
+++ b/chrome/browser/views/external_protocol_dialog.cc
@@ -7,10 +7,10 @@
 #include "app/l10n_util.h"
 #include "app/message_box_flags.h"
 #include "base/metrics/histogram.h"
-#include "base/registry.h"
 #include "base/string_util.h"
 #include "base/thread.h"
 #include "base/utf_string_conversions.h"
+#include "base/win/registry.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/external_protocol_handler.h"
 #include "chrome/browser/tab_contents/tab_contents.h"
@@ -160,7 +160,7 @@ std::wstring ExternalProtocolDialog::GetApplicationForProtocol(
   std::wstring url_spec = ASCIIToWide(url.possibly_invalid_spec());
   std::wstring cmd_key_path =
       ASCIIToWide(url.scheme() + "\\shell\\open\\command");
-  RegKey cmd_key(HKEY_CLASSES_ROOT, cmd_key_path.c_str(), KEY_READ);
+  base::win::RegKey cmd_key(HKEY_CLASSES_ROOT, cmd_key_path.c_str(), KEY_READ);
   size_t split_offset = url_spec.find(L':');
   if (split_offset == std::wstring::npos)
     return std::wstring();
diff --git a/chrome/browser/views/shell_dialogs_win.cc b/chrome/browser/views/shell_dialogs_win.cc
index e8ec6e8cd0170d2eaac2aa0cd092ad96f2a52f07..d3fe7ae382900bf479e9c39850a6b0d94eac6bfb 100644
--- a/chrome/browser/views/shell_dialogs_win.cc
+++ b/chrome/browser/views/shell_dialogs_win.cc
@@ -14,11 +14,11 @@
 #include "app/l10n_util.h"
 #include "base/file_util.h"
 #include "base/message_loop.h"
-#include "base/registry.h"
 #include "base/scoped_comptr_win.h"
 #include "base/string_split.h"
 #include "base/thread.h"
 #include "base/utf_string_conversions.h"
+#include "base/win/registry.h"
 #include "base/win/windows_version.h"
 #include "chrome/browser/browser_thread.h"
 #include "gfx/font.h"
@@ -49,7 +49,7 @@ std::wstring AppendExtensionIfNeeded(const std::wstring& filename,
   std::wstring file_extension(file_util::GetFileExtensionFromPath(filename));
   std::wstring key(L"." + file_extension);
   if (!(filter_selected.empty() || filter_selected == L"*.*") &&
-      !RegKey(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ).Valid() &&
+      !base::win::RegKey(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ).Valid() &&
       file_extension != suggested_ext) {
     if (return_value[return_value.length() - 1] != L'.')
       return_value.append(L".");
@@ -73,10 +73,10 @@ namespace {
 static bool GetRegistryDescriptionFromExtension(const std::wstring& file_ext,
                                                 std::wstring* reg_description) {
   DCHECK(reg_description);
-  RegKey reg_ext(HKEY_CLASSES_ROOT, file_ext.c_str(), KEY_READ);
+  base::win::RegKey reg_ext(HKEY_CLASSES_ROOT, file_ext.c_str(), KEY_READ);
   std::wstring reg_app;
   if (reg_ext.ReadValue(NULL, &reg_app) && !reg_app.empty()) {
-    RegKey reg_link(HKEY_CLASSES_ROOT, reg_app.c_str(), KEY_READ);
+    base::win::RegKey reg_link(HKEY_CLASSES_ROOT, reg_app.c_str(), KEY_READ);
     if (reg_link.ReadValue(NULL, reg_description))
       return true;
   }
diff --git a/chrome/common/chrome_plugin_lib.cc b/chrome/common/chrome_plugin_lib.cc
index 5d1264b0946f34334ebfbfd88ac6dd0c46078ba4..f0dd8c16f9c0a4a227abff4b1a5513bf6cbe8f84 100644
--- a/chrome/common/chrome_plugin_lib.cc
+++ b/chrome/common/chrome_plugin_lib.cc
@@ -12,7 +12,7 @@
 #include "base/perftimer.h"
 #include "base/thread.h"
 #if defined(OS_WIN)
-#include "base/registry.h"
+#include "base/win/registry.h"
 #endif
 #include "base/string_util.h"
 #include "chrome/common/chrome_counters.h"
@@ -149,7 +149,7 @@ void ChromePluginLib::LoadChromePlugins(const CPBrowserFuncs* bfuncs) {
     std::wstring reg_path = kRegistryChromePlugins;
     reg_path.append(L"\\");
     reg_path.append(iter.Name());
-    RegKey key(HKEY_CURRENT_USER, reg_path.c_str());
+    base::win::RegKey key(HKEY_CURRENT_USER, reg_path.c_str());
 
     DWORD is_persistent;
     if (key.ReadValueDW(kRegistryLoadOnStartup, &is_persistent) &&
diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc
index 04bca3006152e27b3d201a302e681e8a7488d625..3a80634fc06da0b808e88c28620e6d2829e48770 100644
--- a/chrome/installer/setup/install.cc
+++ b/chrome/installer/setup/install.cc
@@ -2,17 +2,17 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "chrome/installer/setup/install.h"
+
 #include <shlobj.h>
 #include <time.h>
 
-#include "chrome/installer/setup/install.h"
-
 #include "base/command_line.h"
 #include "base/file_util.h"
 #include "base/logging.h"
 #include "base/path_service.h"
-#include "base/registry.h"
 #include "base/scoped_ptr.h"
+#include "base/win/registry.h"
 #include "chrome/installer/setup/setup_constants.h"
 #include "chrome/installer/util/browser_distribution.h"
 #include "chrome/installer/util/create_reg_key_work_item.h"
@@ -216,7 +216,7 @@ void DeleteUninstallShortcutsForMSI(bool is_system_install) {
 
   // First attempt to delete the old installation's ARP dialog entry.
   HKEY reg_root = is_system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
-  RegKey root_key(reg_root, L"", KEY_ALL_ACCESS);
+  base::win::RegKey root_key(reg_root, L"", KEY_ALL_ACCESS);
   BrowserDistribution* dist = BrowserDistribution::GetDistribution();
   std::wstring uninstall_reg = dist->GetUninstallRegPath();
   InstallUtil::DeleteRegistryKey(root_key, uninstall_reg);
@@ -604,7 +604,8 @@ installer_util::InstallStatus InstallNewVersion(
   std::wstring new_chrome_exe = AppendPath(install_path,
                                            installer_util::kChromeNewExe);
   BrowserDistribution* dist = BrowserDistribution::GetDistribution();
-  RegKey chrome_key(reg_root, dist->GetVersionKey().c_str(), KEY_READ);
+  base::win::RegKey chrome_key(reg_root, dist->GetVersionKey().c_str(),
+                               KEY_READ);
   if (file_util::PathExists(FilePath::FromWStringHack(new_chrome_exe)))
     chrome_key.ReadValue(google_update::kRegOldVersionField, current_version);
   if (current_version->empty())
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc
index 9ab8aab5223d822a74d4d841f137913d53f06adb..173aea9b87bf4227a50545767cb9ecdd5430b1cd 100644
--- a/chrome/installer/setup/uninstall.cc
+++ b/chrome/installer/setup/uninstall.cc
@@ -8,10 +8,10 @@
 
 #include "base/file_util.h"
 #include "base/path_service.h"
-#include "base/registry.h"
 #include "base/string_number_conversions.h"
 #include "base/string_util.h"
 #include "base/utf_string_conversions.h"
+#include "base/win/registry.h"
 #include "base/win/windows_version.h"
 #include "chrome/common/result_codes.h"
 #include "chrome/common/chrome_constants.h"
@@ -30,6 +30,8 @@
 // Build-time generated include file.
 #include "registered_dlls.h"  // NOLINT
 
+using base::win::RegKey;
+
 namespace {
 
 // This functions checks for any Chrome instances that are
diff --git a/chrome/installer/util/browser_distribution.cc b/chrome/installer/util/browser_distribution.cc
index 42200050237a8b1a30c516b16f69c19775b9386a..baf7031a69f2983e3dd88124d1783c040c760ddd 100644
--- a/chrome/installer/util/browser_distribution.cc
+++ b/chrome/installer/util/browser_distribution.cc
@@ -11,7 +11,7 @@
 
 #include "base/command_line.h"
 #include "base/lock.h"
-#include "base/registry.h"
+#include "base/win/registry.h"
 #include "chrome/common/chrome_switches.h"
 #include "chrome/common/env_vars.h"
 #include "chrome/installer/util/chrome_frame_distribution.h"
@@ -122,7 +122,7 @@ std::wstring BrowserDistribution::GetStatsServerURL() {
   return L"";
 }
 
-std::wstring BrowserDistribution::GetDistributionData(RegKey* key) {
+std::wstring BrowserDistribution::GetDistributionData(base::win::RegKey* key) {
   return L"";
 }
 
diff --git a/chrome/installer/util/browser_distribution.h b/chrome/installer/util/browser_distribution.h
index e82996957ac2d9e07b6d31d934096f46a9cd6366..39eecddba17e6977879d0c9f3b50381eba920557 100644
--- a/chrome/installer/util/browser_distribution.h
+++ b/chrome/installer/util/browser_distribution.h
@@ -12,7 +12,11 @@
 #include "chrome/installer/util/util_constants.h"
 #include "chrome/installer/util/version.h"
 
+namespace base {
+namespace win {
 class RegKey;
+}  // namespace win
+}  // namespace base
 
 class BrowserDistribution {
  public:
@@ -53,7 +57,7 @@ class BrowserDistribution {
 
   virtual std::wstring GetStatsServerURL();
 
-  virtual std::wstring GetDistributionData(RegKey* key);
+  virtual std::wstring GetDistributionData(base::win::RegKey* key);
 
   virtual std::wstring GetUninstallLinkName();
 
diff --git a/chrome/installer/util/compat_checks.cc b/chrome/installer/util/compat_checks.cc
index f84a27f0495eea5383081b18d2c9f5ae11e81ee8..09eb0f21f719909a7eb2d49e133fff271bd622b5 100644
--- a/chrome/installer/util/compat_checks.cc
+++ b/chrome/installer/util/compat_checks.cc
@@ -4,10 +4,10 @@
 
 #include "chrome/installer/util/compat_checks.h"
 
-#include "base/registry.h"
 #include "base/string_number_conversions.h"
 #include "base/string_split.h"
 #include "base/string_util.h"
+#include "base/win/registry.h"
 
 namespace {
 
@@ -15,7 +15,7 @@ namespace {
 std::wstring GetSEPVersion() {
   const wchar_t kProductKey[] =
       L"SOFTWARE\\Symantec\\Symantec Endpoint Protection\\SMC";
-  RegKey key(HKEY_LOCAL_MACHINE, kProductKey, KEY_READ);
+  base::win::RegKey key(HKEY_LOCAL_MACHINE, kProductKey, KEY_READ);
   std::wstring version_str;
   key.ReadValue(L"ProductVersion", &version_str);
   return version_str;
diff --git a/chrome/installer/util/create_reg_key_work_item.cc b/chrome/installer/util/create_reg_key_work_item.cc
index 4c1eb2c49be40181c3cb5c12eaa040735e59e009..6c4a2a06c3a08c7b85313ead2fd1c500658089f7 100644
--- a/chrome/installer/util/create_reg_key_work_item.cc
+++ b/chrome/installer/util/create_reg_key_work_item.cc
@@ -6,11 +6,13 @@
 
 #include "base/file_util.h"
 #include "base/logging.h"
-#include "base/registry.h"
+#include "base/win/registry.h"
 #include "chrome/installer/util/create_reg_key_work_item.h"
 #include "chrome/installer/util/install_util.h"
 #include "chrome/installer/util/logging_installer.h"
 
+using base::win::RegKey;
+
 namespace {
 
 // TODO: refactor this because it is only used once.
diff --git a/chrome/installer/util/create_reg_key_work_item_unittest.cc b/chrome/installer/util/create_reg_key_work_item_unittest.cc
index 4f8a9ee28ccdc162e12bb34c6fca86c67049dec9..c4f9d886788abb0de6d8e658060b8e81c1165814 100644
--- a/chrome/installer/util/create_reg_key_work_item_unittest.cc
+++ b/chrome/installer/util/create_reg_key_work_item_unittest.cc
@@ -5,33 +5,38 @@
 #include <windows.h>
 
 #include "base/file_util.h"
-#include "base/registry.h"
 #include "base/scoped_ptr.h"
 #include "base/string_util.h"
+#include "base/win/registry.h"
 #include "chrome/installer/util/create_reg_key_work_item.h"
 #include "chrome/installer/util/work_item.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
+using base::win::RegKey;
+
 namespace {
-  wchar_t test_root[] = L"TmpTmp";
-  class CreateRegKeyWorkItemTest : public testing::Test {
-   protected:
-    virtual void SetUp() {
-      // Create a temporary key for testing
-      RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS);
-      key.DeleteKey(test_root);
-      ASSERT_FALSE(key.Open(HKEY_CURRENT_USER, test_root, KEY_READ));
-      ASSERT_TRUE(key.Create(HKEY_CURRENT_USER, test_root, KEY_READ));
-    }
-    virtual void TearDown() {
-      logging::CloseLogFile();
-      // Clean up the temporary key
-      RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS);
-      ASSERT_TRUE(key.DeleteKey(test_root));
-    }
-  };
+
+wchar_t test_root[] = L"TmpTmp";
+
+class CreateRegKeyWorkItemTest : public testing::Test {
+ protected:
+  virtual void SetUp() {
+    // Create a temporary key for testing
+    RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS);
+    key.DeleteKey(test_root);
+    ASSERT_FALSE(key.Open(HKEY_CURRENT_USER, test_root, KEY_READ));
+    ASSERT_TRUE(key.Create(HKEY_CURRENT_USER, test_root, KEY_READ));
+  }
+  virtual void TearDown() {
+    logging::CloseLogFile();
+    // Clean up the temporary key
+    RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS);
+    ASSERT_TRUE(key.DeleteKey(test_root));
+  }
 };
 
+}  // namespace
+
 TEST_F(CreateRegKeyWorkItemTest, CreateKey) {
   RegKey key;
 
diff --git a/chrome/installer/util/delete_after_reboot_helper.cc b/chrome/installer/util/delete_after_reboot_helper.cc
index 6806f7856a31b68468e6bc45ad416924a6a29676..345ba01a3713b315afb2036c8cfd357c34b93e77 100644
--- a/chrome/installer/util/delete_after_reboot_helper.cc
+++ b/chrome/installer/util/delete_after_reboot_helper.cc
@@ -16,7 +16,7 @@
 #include <vector>
 
 #include "base/file_util.h"
-#include "base/registry.h"
+#include "base/win/registry.h"
 #include "base/string_util.h"
 
 // The moves-pending-reboot is a MULTISZ registry key in the HKLM part of the
@@ -245,8 +245,8 @@ HRESULT GetPendingMovesValue(
 
   // Get the current value of the key
   // If the Key is missing, that's totally acceptable.
-  RegKey session_manager_key(HKEY_LOCAL_MACHINE, kSessionManagerKey,
-                             KEY_QUERY_VALUE);
+  base::win::RegKey session_manager_key(HKEY_LOCAL_MACHINE, kSessionManagerKey,
+                                        KEY_QUERY_VALUE);
   HKEY session_manager_handle = session_manager_key.Handle();
   if (!session_manager_handle) {
     return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
@@ -351,8 +351,8 @@ bool RemoveFromMovesPendingReboot(const wchar_t* directory) {
   }
 
   // Write the key back into a buffer.
-  RegKey session_manager_key(HKEY_LOCAL_MACHINE, kSessionManagerKey,
-                             KEY_CREATE_SUB_KEY | KEY_SET_VALUE);
+  base::win::RegKey session_manager_key(HKEY_LOCAL_MACHINE, kSessionManagerKey,
+                                        KEY_CREATE_SUB_KEY | KEY_SET_VALUE);
   if (!session_manager_key.Handle()) {
     // Couldn't open / create the key.
     LOG(ERROR) << "Failed to open session manager key for writing.";
diff --git a/chrome/installer/util/delete_after_reboot_helper_unittest.cc b/chrome/installer/util/delete_after_reboot_helper_unittest.cc
index 114825cb85159a2ef063be7d6e90f865b3d1f64e..5d8adafed0589411a022f0339c565c6f4c9f0b7b 100644
--- a/chrome/installer/util/delete_after_reboot_helper_unittest.cc
+++ b/chrome/installer/util/delete_after_reboot_helper_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
@@ -6,9 +6,9 @@
 #include <shlobj.h>
 
 #include "base/file_util.h"
-#include "base/registry.h"
 #include "base/scoped_ptr.h"
 #include "base/string_util.h"
+#include "base/win/registry.h"
 #include "chrome/installer/util/delete_after_reboot_helper.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -43,8 +43,9 @@ class DeleteAfterRebootHelperTest : public testing::Test {
 
     // Try and restore the pending moves value, if we have one.
     if (IsUserAnAdmin() && original_pending_moves_.size() > 1) {
-      RegKey session_manager_key(HKEY_LOCAL_MACHINE, kSessionManagerKey,
-                                 KEY_CREATE_SUB_KEY | KEY_SET_VALUE);
+      base::win::RegKey session_manager_key(
+          HKEY_LOCAL_MACHINE, kSessionManagerKey,
+          KEY_CREATE_SUB_KEY | KEY_SET_VALUE);
       if (!session_manager_key.Handle()) {
         // Couldn't open / create the key.
         DLOG(ERROR) << "Failed to open session manager key for writing.";
diff --git a/chrome/installer/util/delete_reg_value_work_item.cc b/chrome/installer/util/delete_reg_value_work_item.cc
index 7246d5201ca291bc831eb6e27726613f5a5958d5..1c114e2c11e0b71baac4775f2c7daa6ceceb51c2 100644
--- a/chrome/installer/util/delete_reg_value_work_item.cc
+++ b/chrome/installer/util/delete_reg_value_work_item.cc
@@ -5,9 +5,11 @@
 #include "chrome/installer/util/delete_reg_value_work_item.h"
 
 #include "base/logging.h"
-#include "base/registry.h"
+#include "base/win/registry.h"
 #include "chrome/installer/util/logging_installer.h"
 
+using base::win::RegKey;
+
 DeleteRegValueWorkItem::DeleteRegValueWorkItem(HKEY predefined_root,
                                                const std::wstring& key_path,
                                                const std::wstring& value_name,
diff --git a/chrome/installer/util/delete_reg_value_work_item_unittest.cc b/chrome/installer/util/delete_reg_value_work_item_unittest.cc
index c9d5783d03e35f0fd54cbf392813ee0cf6e9cde4..fcec35cfdc547dceb36373388e3d5825f4585706 100644
--- a/chrome/installer/util/delete_reg_value_work_item_unittest.cc
+++ b/chrome/installer/util/delete_reg_value_work_item_unittest.cc
@@ -1,37 +1,42 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
 #include <windows.h>
 
 #include "base/file_util.h"
-#include "base/registry.h"
 #include "base/scoped_ptr.h"
 #include "base/string_util.h"
+#include "base/win/registry.h"
 #include "chrome/installer/util/delete_reg_value_work_item.h"
 #include "chrome/installer/util/work_item.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
+using base::win::RegKey;
+
 namespace {
-  wchar_t test_root[] = L"DeleteRegValueWorkItemTest";
-  class DeleteRegValueWorkItemTest : public testing::Test {
-   protected:
-    virtual void SetUp() {
-      // Create a temporary key for testing
-      RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS);
-      key.DeleteKey(test_root);
-      ASSERT_FALSE(key.Open(HKEY_CURRENT_USER, test_root, KEY_READ));
-      ASSERT_TRUE(key.Create(HKEY_CURRENT_USER, test_root, KEY_READ));
-    }
-    virtual void TearDown() {
-      logging::CloseLogFile();
-      // Clean up the temporary key
-      RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS);
-      ASSERT_TRUE(key.DeleteKey(test_root));
-    }
-  };
+
+wchar_t test_root[] = L"DeleteRegValueWorkItemTest";
+
+class DeleteRegValueWorkItemTest : public testing::Test {
+ protected:
+  virtual void SetUp() {
+    // Create a temporary key for testing
+    RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS);
+    key.DeleteKey(test_root);
+    ASSERT_FALSE(key.Open(HKEY_CURRENT_USER, test_root, KEY_READ));
+    ASSERT_TRUE(key.Create(HKEY_CURRENT_USER, test_root, KEY_READ));
+  }
+  virtual void TearDown() {
+    logging::CloseLogFile();
+    // Clean up the temporary key
+    RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS);
+    ASSERT_TRUE(key.DeleteKey(test_root));
+  }
 };
 
+}  // namespace
+
 // Delete a value. The value should get deleted after Do() and should be
 // recreated after Rollback().
 TEST_F(DeleteRegValueWorkItemTest, DeleteExistingValue) {
diff --git a/chrome/installer/util/google_chrome_distribution.cc b/chrome/installer/util/google_chrome_distribution.cc
index c0fc09dcbe5bd8fa9f4f45f0167561f5f33ea9e3..90c684c5b5573c27f70029ebf97520e8f6dfdf61 100644
--- a/chrome/installer/util/google_chrome_distribution.cc
+++ b/chrome/installer/util/google_chrome_distribution.cc
@@ -16,11 +16,11 @@
 #include "base/file_path.h"
 #include "base/path_service.h"
 #include "base/rand_util.h"
-#include "base/registry.h"
 #include "base/scoped_ptr.h"
 #include "base/string_number_conversions.h"
 #include "base/string_util.h"
 #include "base/utf_string_conversions.h"
+#include "base/win/registry.h"
 #include "base/win/windows_version.h"
 #include "chrome/common/chrome_switches.h"
 #include "chrome/common/json_value_serializer.h"
@@ -39,6 +39,7 @@
 #pragma comment(lib, "wtsapi32.lib")
 
 namespace {
+
 const wchar_t kChromeGuid[] = L"{8A69D345-D564-463c-AFF1-A69D9E530F96}";
 const wchar_t kBrowserAppId[] = L"Chrome";
 
@@ -437,13 +438,14 @@ std::wstring GoogleChromeDistribution::GetStatsServerURL() {
   return L"https://clients4.google.com/firefox/metrics/collect";
 }
 
-std::wstring GoogleChromeDistribution::GetDistributionData(RegKey* key) {
+std::wstring GoogleChromeDistribution::GetDistributionData(
+    base::win::RegKey* key) {
   DCHECK(NULL != key);
   std::wstring sub_key(google_update::kRegPathClientState);
   sub_key.append(L"\\");
   sub_key.append(product_guid());
 
-  RegKey client_state_key(key->Handle(), sub_key.c_str(), KEY_READ);
+  base::win::RegKey client_state_key(key->Handle(), sub_key.c_str(), KEY_READ);
   std::wstring result;
   std::wstring brand_value;
   if (client_state_key.ReadValue(google_update::kRegRLZBrandField,
diff --git a/chrome/installer/util/google_chrome_distribution.h b/chrome/installer/util/google_chrome_distribution.h
index a8eb493039e20e8939f369a5ef8965916ba34446..53d754ba16b541d0282ba758e15c09aa260a801c 100644
--- a/chrome/installer/util/google_chrome_distribution.h
+++ b/chrome/installer/util/google_chrome_distribution.h
@@ -55,7 +55,7 @@ class GoogleChromeDistribution : public BrowserDistribution {
   // This method reads data from the Google Update ClientState key for
   // potential use in the uninstall survey. It must be called before the
   // key returned by GetVersionKey() is deleted.
-  virtual std::wstring GetDistributionData(RegKey* key);
+  virtual std::wstring GetDistributionData(base::win::RegKey* key);
 
   virtual std::wstring GetUninstallLinkName();
 
diff --git a/chrome/installer/util/google_chrome_distribution_dummy.cc b/chrome/installer/util/google_chrome_distribution_dummy.cc
index b2cafe94b96fdd58a0249435fbfaf08c25bc6c46..a50dd1146318b2a2e6fcbc055e82a09119f83949 100644
--- a/chrome/installer/util/google_chrome_distribution_dummy.cc
+++ b/chrome/installer/util/google_chrome_distribution_dummy.cc
@@ -78,7 +78,8 @@ std::wstring GoogleChromeDistribution::GetStatsServerURL() {
   return std::wstring();
 }
 
-std::wstring GoogleChromeDistribution::GetDistributionData(RegKey* key) {
+std::wstring GoogleChromeDistribution::GetDistributionData(
+    base::win::RegKey* key) {
   NOTREACHED();
   return std::wstring();
 }
diff --git a/chrome/installer/util/google_update_settings.cc b/chrome/installer/util/google_update_settings.cc
index 91867f320767d47622ebecff7d1cf6a697ef31bf..747fbb198e60a41e4edb34ab94e76ed4701d7334 100644
--- a/chrome/installer/util/google_update_settings.cc
+++ b/chrome/installer/util/google_update_settings.cc
@@ -7,15 +7,17 @@
 #include <algorithm>
 
 #include "base/command_line.h"
-#include "base/registry.h"
 #include "base/string_number_conversions.h"
 #include "base/string_util.h"
 #include "base/time.h"
+#include "base/win/registry.h"
 #include "chrome/common/chrome_switches.h"
 #include "chrome/installer/util/browser_distribution.h"
 #include "chrome/installer/util/google_update_constants.h"
 #include "chrome/installer/util/install_util.h"
 
+using base::win::RegKey;
+
 namespace {
 
 bool ReadGoogleUpdateStrKey(const wchar_t* const name, std::wstring* value) {
diff --git a/chrome/installer/util/google_update_settings_unittest.cc b/chrome/installer/util/google_update_settings_unittest.cc
index 5b5d1e270e6e6e6143b84b75e6ea58c1e847d019..75f15a870868bdde7b8f9a84d697cc4fc1edf2a8 100644
--- a/chrome/installer/util/google_update_settings_unittest.cc
+++ b/chrome/installer/util/google_update_settings_unittest.cc
@@ -5,14 +5,16 @@
 #include <windows.h>
 #include <shlwapi.h> // For SHDeleteKey.
 
-#include "base/registry.h"
 #include "base/scoped_ptr.h"
+#include "base/win/registry.h"
 #include "chrome/installer/util/browser_distribution.h"
 #include "chrome/installer/util/google_update_constants.h"
 #include "chrome/installer/util/google_update_settings.h"
 #include "chrome/installer/util/work_item_list.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
+using base::win::RegKey;
+
 namespace {
 
 const wchar_t kHKCUReplacement[] =
diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc
index a0dfad1d7d1979a888e7821bccc74c9998e5efa6..601d0ebbaf11ce5d15bd701a5ebc1a499cbbe5dd 100644
--- a/chrome/installer/util/install_util.cc
+++ b/chrome/installer/util/install_util.cc
@@ -16,10 +16,10 @@
 #include "base/file_util.h"
 #include "base/logging.h"
 #include "base/path_service.h"
-#include "base/registry.h"
 #include "base/scoped_ptr.h"
 #include "base/string_util.h"
 #include "base/values.h"
+#include "base/win/registry.h"
 #include "base/win/windows_version.h"
 #include "chrome/common/json_value_serializer.h"
 #include "chrome/installer/util/browser_distribution.h"
@@ -29,6 +29,8 @@
 #include "chrome/installer/util/util_constants.h"
 #include "chrome/installer/util/work_item_list.h"
 
+using base::win::RegKey;
+
 bool InstallUtil::ExecuteExeAsAdmin(const std::wstring& exe,
                                     const std::wstring& params,
                                     DWORD* exit_code) {
diff --git a/chrome/installer/util/install_util.h b/chrome/installer/util/install_util.h
index e72cf04ce429e98f952342e5938df9648447e26d..f33bfb6a2948b3f16d6b07583ae87da558568cea 100644
--- a/chrome/installer/util/install_util.h
+++ b/chrome/installer/util/install_util.h
@@ -19,7 +19,12 @@
 #include "chrome/installer/util/version.h"
 
 class WorkItemList;
+
+namespace base {
+namespace win {
 class RegKey;
+}  // namespace win
+}  // namespace base
 
 // This is a utility class that provides common installation related
 // utility methods that can be used by installer and also unit tested
@@ -105,7 +110,8 @@ class InstallUtil {
                                        WorkItemList* registration_list);
 
   // Deletes the registry key at path key_path under the key given by root_key.
-  static bool DeleteRegistryKey(RegKey& root_key, const std::wstring& key_path);
+  static bool DeleteRegistryKey(base::win::RegKey& root_key,
+                                const std::wstring& key_path);
 
   // Deletes the registry value named value_name at path key_path under the key
   // given by reg_root.
diff --git a/chrome/installer/util/set_reg_value_work_item.cc b/chrome/installer/util/set_reg_value_work_item.cc
index 0cf9129d4c0e8e97153c0f593e99d198cf262a95..0dae573a9612c9387da164587321b3e1e93dd9a8 100644
--- a/chrome/installer/util/set_reg_value_work_item.cc
+++ b/chrome/installer/util/set_reg_value_work_item.cc
@@ -5,7 +5,7 @@
 #include "chrome/installer/util/set_reg_value_work_item.h"
 
 #include "base/logging.h"
-#include "base/registry.h"
+#include "base/win/registry.h"
 #include "chrome/installer/util/logging_installer.h"
 
 SetRegValueWorkItem::~SetRegValueWorkItem() {
@@ -49,7 +49,7 @@ bool SetRegValueWorkItem::Do() {
     return false;
   }
 
-  RegKey key;
+  base::win::RegKey key;
   if (!key.Open(predefined_root_, key_path_.c_str(),
                 KEY_READ | KEY_SET_VALUE)) {
     LOG(ERROR) << "can not open " << key_path_;
@@ -121,7 +121,7 @@ void SetRegValueWorkItem::Rollback() {
     return;
   }
 
-  RegKey key;
+  base::win::RegKey key;
   if (!key.Open(predefined_root_, key_path_.c_str(),
                 KEY_READ | KEY_SET_VALUE)) {
     status_ = VALUE_ROLL_BACK;
diff --git a/chrome/installer/util/set_reg_value_work_item_unittest.cc b/chrome/installer/util/set_reg_value_work_item_unittest.cc
index 7e347e21ba707884ee0f0885616549d510e1dcc2..13faba565ee0435b92892189d5c6f8fcf4341cab 100644
--- a/chrome/installer/util/set_reg_value_work_item_unittest.cc
+++ b/chrome/installer/util/set_reg_value_work_item_unittest.cc
@@ -5,37 +5,41 @@
 #include <windows.h>
 
 #include "base/file_util.h"
-#include "base/registry.h"
 #include "base/scoped_ptr.h"
 #include "base/string_util.h"
+#include "base/win/registry.h"
 #include "chrome/installer/util/set_reg_value_work_item.h"
 #include "chrome/installer/util/work_item.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
+using base::win::RegKey;
+
 namespace {
-  wchar_t test_root[] = L"TempTemp";
-  wchar_t data_str_1[] = L"data_111";
-  wchar_t data_str_2[] = L"data_222";
-  DWORD dword1 = 0;
-  DWORD dword2 = 1;
-  class SetRegValueWorkItemTest : public testing::Test {
-   protected:
-    virtual void SetUp() {
-      // Create a temporary key for testing
-      RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS);
-      key.DeleteKey(test_root);
-      ASSERT_FALSE(key.Open(HKEY_CURRENT_USER, test_root, KEY_READ));
-      ASSERT_TRUE(key.Create(HKEY_CURRENT_USER, test_root, KEY_READ));
-    }
-    virtual void TearDown() {
-      logging::CloseLogFile();
-      // Clean up the temporary key
-      RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS);
-      ASSERT_TRUE(key.DeleteKey(test_root));
-    }
-  };
+
+wchar_t test_root[] = L"TempTemp";
+wchar_t data_str_1[] = L"data_111";
+wchar_t data_str_2[] = L"data_222";
+DWORD dword1 = 0;
+DWORD dword2 = 1;
+class SetRegValueWorkItemTest : public testing::Test {
+ protected:
+  virtual void SetUp() {
+    // Create a temporary key for testing
+    RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS);
+    key.DeleteKey(test_root);
+    ASSERT_FALSE(key.Open(HKEY_CURRENT_USER, test_root, KEY_READ));
+    ASSERT_TRUE(key.Create(HKEY_CURRENT_USER, test_root, KEY_READ));
+  }
+  virtual void TearDown() {
+    logging::CloseLogFile();
+    // Clean up the temporary key
+    RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS);
+    ASSERT_TRUE(key.DeleteKey(test_root));
+  }
 };
 
+}  // namespace
+
 // Write a new value without overwrite flag. The value should be set.
 TEST_F(SetRegValueWorkItemTest, WriteNewNonOverwrite) {
   RegKey key;
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc
index 257a78fad7d44331743c6d1c678d685d10fd3ff0..212f04b79d74e73415f8f5687c9f9b6b3862c061 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -16,7 +16,6 @@
 #include "base/file_path.h"
 #include "base/file_util.h"
 #include "base/logging.h"
-#include "base/registry.h"
 #include "base/scoped_ptr.h"
 #include "base/stl_util-inl.h"
 #include "base/string_number_conversions.h"
@@ -24,6 +23,7 @@
 #include "base/string_util.h"
 #include "base/utf_string_conversions.h"
 #include "base/values.h"
+#include "base/win/registry.h"
 #include "base/win/windows_version.h"
 #include "chrome/common/chrome_constants.h"
 #include "chrome/common/chrome_switches.h"
@@ -33,6 +33,8 @@
 
 #include "installer_util_strings.h"
 
+using base::win::RegKey;
+
 namespace {
 
 // This class represents a single registry entry. The objective is to
@@ -570,7 +572,8 @@ void ShellUtil::GetRegisteredBrowsers(std::map<std::wstring,
                                       std::wstring>* browsers) {
   std::wstring base_key(ShellUtil::kRegStartMenuInternet);
   HKEY root = HKEY_LOCAL_MACHINE;
-  for (RegistryKeyIterator iter(root, base_key.c_str()); iter.Valid(); ++iter) {
+  for (base::win::RegistryKeyIterator iter(root, base_key.c_str());
+       iter.Valid(); ++iter) {
     std::wstring key = base_key + L"\\" + iter.Name();
     RegKey capabilities(root, (key + L"\\Capabilities").c_str(), KEY_READ);
     std::wstring name;
diff --git a/chrome/installer/util/work_item_list_unittest.cc b/chrome/installer/util/work_item_list_unittest.cc
index 8b91fcdd9eadc1fa88232af3cade051baf361906..1ba6e5234446a1d868c39141c5eb22a13dd49dd3 100644
--- a/chrome/installer/util/work_item_list_unittest.cc
+++ b/chrome/installer/util/work_item_list_unittest.cc
@@ -7,49 +7,53 @@
 #include "base/base_paths.h"
 #include "base/file_util.h"
 #include "base/path_service.h"
-#include "base/registry.h"
 #include "base/scoped_ptr.h"
 #include "base/string_util.h"
+#include "base/win/registry.h"
 #include "chrome/installer/util/work_item.h"
 #include "chrome/installer/util/work_item_list.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
+using base::win::RegKey;
+
 namespace {
-  wchar_t test_root[] = L"ListList";
-  wchar_t data_str[] = L"data_111";
-
-  class WorkItemListTest : public testing::Test {
-   protected:
-    virtual void SetUp() {
-      // Create a temporary key for testing
-      RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS);
-      key.DeleteKey(test_root);
-      ASSERT_FALSE(key.Open(HKEY_CURRENT_USER, test_root, KEY_READ));
-      ASSERT_TRUE(key.Create(HKEY_CURRENT_USER, test_root, KEY_READ));
-
-      // Create a temp directory for test.
-      ASSERT_TRUE(PathService::Get(base::DIR_TEMP, &test_dir_));
-      test_dir_ = test_dir_.AppendASCII("WorkItemListTest");
-      file_util::Delete(test_dir_, true);
-      ASSERT_FALSE(file_util::PathExists(test_dir_));
-      file_util::CreateDirectoryW(test_dir_);
-      ASSERT_TRUE(file_util::PathExists(test_dir_));
-    }
-
-    virtual void TearDown() {
-      logging::CloseLogFile();
-      // Clean up test directory
-      ASSERT_TRUE(file_util::Delete(test_dir_, true));
-      ASSERT_FALSE(file_util::PathExists(test_dir_));
-      // Clean up the temporary key
-      RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS);
-      ASSERT_TRUE(key.DeleteKey(test_root));
-    }
-
-    FilePath test_dir_;
-  };
+
+wchar_t test_root[] = L"ListList";
+wchar_t data_str[] = L"data_111";
+
+class WorkItemListTest : public testing::Test {
+ protected:
+  virtual void SetUp() {
+    // Create a temporary key for testing
+    RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS);
+    key.DeleteKey(test_root);
+    ASSERT_FALSE(key.Open(HKEY_CURRENT_USER, test_root, KEY_READ));
+    ASSERT_TRUE(key.Create(HKEY_CURRENT_USER, test_root, KEY_READ));
+
+    // Create a temp directory for test.
+    ASSERT_TRUE(PathService::Get(base::DIR_TEMP, &test_dir_));
+    test_dir_ = test_dir_.AppendASCII("WorkItemListTest");
+    file_util::Delete(test_dir_, true);
+    ASSERT_FALSE(file_util::PathExists(test_dir_));
+    file_util::CreateDirectoryW(test_dir_);
+    ASSERT_TRUE(file_util::PathExists(test_dir_));
+  }
+
+  virtual void TearDown() {
+    logging::CloseLogFile();
+    // Clean up test directory
+    ASSERT_TRUE(file_util::Delete(test_dir_, true));
+    ASSERT_FALSE(file_util::PathExists(test_dir_));
+    // Clean up the temporary key
+    RegKey key(HKEY_CURRENT_USER, L"", KEY_ALL_ACCESS);
+    ASSERT_TRUE(key.DeleteKey(test_root));
+  }
+
+  FilePath test_dir_;
 };
 
+}  // namespace
+
 // Execute a WorkItem list successfully and then rollback.
 TEST_F(WorkItemListTest, ExecutionSuccess) {
   scoped_ptr<WorkItemList> work_item_list(WorkItem::CreateWorkItemList());
diff --git a/chrome/test/mini_installer_test/chrome_mini_installer.cc b/chrome/test/mini_installer_test/chrome_mini_installer.cc
index e53b020a7150084df22a5f24ca5db1c77d2e38bc..0d1871676708a1c8a7d94d5ce8c5afc6f538c786 100644
--- a/chrome/test/mini_installer_test/chrome_mini_installer.cc
+++ b/chrome/test/mini_installer_test/chrome_mini_installer.cc
@@ -10,15 +10,17 @@
 #include "base/platform_thread.h"
 #include "base/process.h"
 #include "base/process_util.h"
-#include "base/registry.h"
 #include "base/string_number_conversions.h"
 #include "base/string_util.h"
+#include "base/win/registry.h"
 #include "chrome/installer/util/browser_distribution.h"
 #include "chrome/installer/util/google_update_constants.h"
 #include "chrome/test/mini_installer_test/mini_installer_test_constants.h"
 #include "chrome/test/mini_installer_test/mini_installer_test_util.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
+using base::win::RegKey;
+
 ChromeMiniInstaller::ChromeMiniInstaller(const std::wstring& install_type,
                                          bool is_chrome_frame)
     : is_chrome_frame_(is_chrome_frame),
diff --git a/chrome/test/plugin/plugin_test.cpp b/chrome/test/plugin/plugin_test.cpp
index 0a9ca83e5a9974b38c55e037c0a8b600e68f9a4f..56d41aa29098a5f8271660a58d902d0764af4be9 100644
--- a/chrome/test/plugin/plugin_test.cpp
+++ b/chrome/test/plugin/plugin_test.cpp
@@ -51,7 +51,7 @@
 #include "webkit/glue/plugins/plugin_list.h"
 
 #if defined(OS_WIN)
-#include "base/registry.h"
+#include "base/win/registry.h"
 #endif
 
 class PluginTest : public UITest {
@@ -80,7 +80,7 @@ class PluginTest : public UITest {
     if (strcmp(test_info->name(), "MediaPlayerNew") == 0) {
       // The installer adds our process names to the registry key below.  Since
       // the installer might not have run on this machine, add it manually.
-      RegKey regkey;
+      base::win::RegKey regkey;
       if (regkey.Open(HKEY_LOCAL_MACHINE,
                       L"Software\\Microsoft\\MediaPlayer\\ShimInclusionList",
                       KEY_WRITE)) {
diff --git a/chrome_frame/chrome_tab.cc b/chrome_frame/chrome_tab.cc
index 013995d278aea71c36fd95cd94abd7316403a5e5..b81be695ef5e4a0aac7dd2945bf1f61fce747532 100644
--- a/chrome_frame/chrome_tab.cc
+++ b/chrome_frame/chrome_tab.cc
@@ -17,11 +17,11 @@
 #include "base/logging.h"
 #include "base/logging_win.h"
 #include "base/path_service.h"
-#include "base/registry.h"
 #include "base/string_number_conversions.h"
 #include "base/string_piece.h"
 #include "base/string_util.h"
 #include "base/sys_string_conversions.h"
+#include "base/win/registry.h"
 #include "base/win/windows_version.h"
 #include "chrome/common/chrome_constants.h"
 #include "chrome/common/chrome_switches.h"
@@ -40,6 +40,8 @@
 #include "chrome_frame/utils.h"
 #include "googleurl/src/url_util.h"
 
+using base::win::RegKey;
+
 namespace {
 // This function has the side effect of initializing an unprotected
 // vector pointer inside GoogleUrl. If this is called during DLL loading,
diff --git a/chrome_frame/crash_reporting/crash_metrics.cc b/chrome_frame/crash_reporting/crash_metrics.cc
index 3a6c9ee8232397c0a37308f7edb14728b4bbe67c..e5d8fb5935bae7e117befbea890280031d1e0265 100644
--- a/chrome_frame/crash_reporting/crash_metrics.cc
+++ b/chrome_frame/crash_reporting/crash_metrics.cc
@@ -5,7 +5,7 @@
 #include "chrome_frame/crash_reporting/crash_metrics.h"
 
 #include "base/metrics/histogram.h"
-#include "base/registry.h"
+#include "base/win/registry.h"
 #include "chrome_frame/utils.h"
 
 static const wchar_t kChromeFrameMetricsKey[] =
@@ -28,7 +28,7 @@ CrashMetricsReporter* CrashMetricsReporter::GetInstance() {
 bool CrashMetricsReporter::SetMetric(Metric metric, int value) {
   DCHECK(metric >= NAVIGATION_COUNT && metric <= LAST_METRIC);
 
-  RegKey metric_key;
+  base::win::RegKey metric_key;
   if (metric_key.Create(HKEY_CURRENT_USER, kChromeFrameMetricsKey,
                         KEY_SET_VALUE)) {
     if (metric_key.WriteValue(g_metric_names[metric], value)) {
@@ -47,7 +47,7 @@ int CrashMetricsReporter::GetMetric(Metric metric) {
   DCHECK(metric >= NAVIGATION_COUNT && metric <= LAST_METRIC);
 
   int ret = 0;
-  RegKey metric_key;
+  base::win::RegKey metric_key;
   if (metric_key.Open(HKEY_CURRENT_USER, kChromeFrameMetricsKey,
                       KEY_QUERY_VALUE)) {
     int value = 0;
diff --git a/chrome_frame/policy_settings.cc b/chrome_frame/policy_settings.cc
index 7e5be2c366f197d7a2f9fad9a4fbbb02d0bfe84f..d00e69a8e3aca8e17656ad35b5c0371546ce92ab 100644
--- a/chrome_frame/policy_settings.cc
+++ b/chrome_frame/policy_settings.cc
@@ -5,9 +5,9 @@
 #include "chrome_frame/policy_settings.h"
 
 #include "base/logging.h"
-#include "base/registry.h"
 #include "base/string_util.h"
 #include "base/utf_string_conversions.h"
+#include "base/win/registry.h"
 #include "chrome/common/policy_constants.h"
 #include "chrome_frame/utils.h"
 
@@ -45,7 +45,7 @@ void PolicySettings::RefreshFromRegistry() {
   default_renderer_ = RENDERER_NOT_SPECIFIED;
   renderer_exclusion_list_.clear();
 
-  RegKey config_key;
+  base::win::RegKey config_key;
   DWORD value = RENDERER_NOT_SPECIFIED;
   HKEY root_key[] = { HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER };
   std::wstring settings_value(
diff --git a/chrome_frame/test/chrome_frame_test_utils.cc b/chrome_frame/test/chrome_frame_test_utils.cc
index e98d3539994a47e0a9fc473dfe6c54a04589bbbb..99fedd22721045fdbbf67b2c5a0610ad6d6f0e1d 100644
--- a/chrome_frame/test/chrome_frame_test_utils.cc
+++ b/chrome_frame/test/chrome_frame_test_utils.cc
@@ -14,13 +14,13 @@
 #include "base/file_version_info.h"
 #include "base/path_service.h"
 #include "base/process_util.h"
-#include "base/registry.h"   // to find IE and firefox
 #include "base/scoped_handle.h"
 #include "base/scoped_ptr.h"
 #include "base/string_util.h"
 #include "base/stringprintf.h"
 #include "base/utf_string_conversions.h"
 #include "base/win_util.h"
+#include "base/win/registry.h"
 #include "base/win/windows_version.h"
 #include "chrome/common/chrome_switches.h"
 #include "chrome/common/chrome_paths.h"
@@ -116,7 +116,8 @@ std::wstring GetExecutableAppPath(const std::wstring& file) {
       L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\";
 
   std::wstring app_path;
-  RegKey key(HKEY_LOCAL_MACHINE, (kAppPathsKey + file).c_str(), KEY_READ);
+  base::win::RegKey key(HKEY_LOCAL_MACHINE, (kAppPathsKey + file).c_str(),
+                        KEY_READ);
   if (key.Handle()) {
     key.ReadValue(NULL, &app_path);
   }
@@ -129,7 +130,7 @@ std::wstring FormatCommandForApp(const std::wstring& exe_name,
   std::wstring reg_path(
       base::StringPrintf(L"Applications\\%ls\\shell\\open\\command",
                          exe_name.c_str()));
-  RegKey key(HKEY_CLASSES_ROOT, reg_path.c_str(), KEY_READ);
+  base::win::RegKey key(HKEY_CLASSES_ROOT, reg_path.c_str(), KEY_READ);
 
   std::wstring command;
   if (key.Handle()) {
diff --git a/chrome_frame/test/perf/chrome_frame_perftest.cc b/chrome_frame/test/perf/chrome_frame_perftest.cc
index 729f787c040039d625d5ab5db6f326ddce694cf0..34c11831287ed01a9c9865e3d57afb4e27c9e780 100644
--- a/chrome_frame/test/perf/chrome_frame_perftest.cc
+++ b/chrome_frame/test/perf/chrome_frame_perftest.cc
@@ -17,7 +17,6 @@
 #include "base/file_util.h"
 #include "base/path_service.h"
 #include "base/process_util.h"
-#include "base/registry.h"
 #include "base/scoped_ptr.h"
 #include "base/scoped_bstr_win.h"
 #include "base/scoped_comptr_win.h"
@@ -27,6 +26,7 @@
 #include "base/time.h"
 #include "base/trace_event_win.h"
 #include "base/utf_string_conversions.h"
+#include "base/win/registry.h"
 #include "chrome/common/chrome_constants.h"
 #include "chrome/common/chrome_paths.h"
 #include "chrome/common/chrome_paths_internal.h"
@@ -1092,7 +1092,7 @@ TEST_F(ChromeFrameCreationTest, PerfCold) {
 // from the cache. This could also fail if the Flash control is in use.
 // On Vista this could fail because of UAC
 TEST_F(FlashCreationTest, PerfCold) {
-  RegKey flash_key(HKEY_CLASSES_ROOT, kFlashControlKey, KEY_READ);
+  base::win::RegKey flash_key(HKEY_CLASSES_ROOT, kFlashControlKey, KEY_READ);
 
   std::wstring plugin_path;
   ASSERT_TRUE(flash_key.ReadValue(L"", &plugin_path));
@@ -1112,7 +1112,8 @@ TEST_F(FlashCreationTest, PerfCold) {
 // correctly causing the attempt to evict the dll from the system cache to
 // fail.
 TEST_F(SilverlightCreationTest, DISABLED_PerfCold) {
-  RegKey silverlight_key(HKEY_CLASSES_ROOT, kSilverlightControlKey, KEY_READ);
+  base::win::RegKey silverlight_key(HKEY_CLASSES_ROOT, kSilverlightControlKey,
+                                    KEY_READ);
 
   std::wstring plugin_path;
   ASSERT_TRUE(silverlight_key.ReadValue(L"", &plugin_path));
diff --git a/chrome_frame/test/policy_settings_unittest.cc b/chrome_frame/test/policy_settings_unittest.cc
index a31e764999283bc2b3eaf56bf14afb8822090fd1..52a3c5507c595787fd26d34c98299d83ee95e801 100644
--- a/chrome_frame/test/policy_settings_unittest.cc
+++ b/chrome_frame/test/policy_settings_unittest.cc
@@ -4,14 +4,16 @@
 
 #include "base/basictypes.h"
 #include "base/logging.h"
-#include "base/registry.h"
 #include "base/scoped_ptr.h"
 #include "base/stringprintf.h"
 #include "base/utf_string_conversions.h"
+#include "base/win/registry.h"
 #include "chrome/common/policy_constants.h"
 #include "chrome_frame/policy_settings.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
+using base::win::RegKey;
+
 namespace {
 
 // A best effort way to zap CF policy entries that may be in the registry.
diff --git a/chrome_frame/test/util_unittests.cc b/chrome_frame/test/util_unittests.cc
index 055bae9e5c03eaf464dea1e74f3fc40eb1f13549..bc18062639686877b1b4db001d4b6a4e256d24f3 100644
--- a/chrome_frame/test/util_unittests.cc
+++ b/chrome_frame/test/util_unittests.cc
@@ -5,12 +5,14 @@
 #include "base/file_path.h"
 #include "base/file_version_info.h"
 #include "base/file_version_info_win.h"
-#include "base/registry.h"
+#include "base/win/registry.h"
 #include "chrome_frame/utils.h"
 
 #include "testing/gtest/include/gtest/gtest.h"
 #include "testing/gmock/include/gmock/gmock.h"
 
+using base::win::RegKey;
+
 const wchar_t kChannelName[] = L"-dev";
 const wchar_t kSuffix[] = L"-fix";
 
diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc
index ec631bd6a49e29c1ed4ef8d281e7c2d7e908e10b..44376687c24d0b0818ac7d78bd7960d959e0f59b 100644
--- a/chrome_frame/utils.cc
+++ b/chrome_frame/utils.cc
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "chrome_frame/utils.h"
+
 #include <htiframe.h>
 #include <mshtml.h>
 #include <shlobj.h>
@@ -14,7 +16,6 @@
 #include "base/lazy_instance.h"
 #include "base/logging.h"
 #include "base/path_service.h"
-#include "base/registry.h"
 #include "base/scoped_bstr_win.h"
 #include "base/scoped_comptr_win.h"
 #include "base/scoped_variant_win.h"
@@ -24,6 +25,7 @@
 #include "base/stringprintf.h"
 #include "base/thread_local.h"
 #include "base/utf_string_conversions.h"
+#include "base/win/registry.h"
 #include "chrome/common/chrome_paths_internal.h"
 #include "chrome/common/url_constants.h"
 #include "chrome/installer/util/chrome_frame_distribution.h"
@@ -31,14 +33,14 @@
 #include "chrome_frame/html_utils.h"
 #include "chrome_frame/policy_settings.h"
 #include "chrome_frame/simple_resource_loader.h"
-#include "chrome_frame/utils.h"
 #include "googleurl/src/gurl.h"
 #include "googleurl/src/url_canon.h"
-
 #include "grit/chromium_strings.h"
 #include "net/base/escape.h"
 #include "net/http/http_util.h"
 
+using base::win::RegKey;
+
 // Note that these values are all lower case and are compared to
 // lower-case-transformed values.
 const wchar_t kMetaTag[] = L"meta";
@@ -754,7 +756,7 @@ RendererType RendererTypeForUrl(const std::wstring& url) {
   }
 
   bool match_found = false;
-  RegistryValueIterator url_list(config_key.Handle(), url_list_name);
+  base::win::RegistryValueIterator url_list(config_key.Handle(), url_list_name);
   while (!match_found && url_list.Valid()) {
     if (MatchPattern(url, url_list.Name())) {
       match_found = true;
@@ -1518,7 +1520,7 @@ void WaitWithMessageLoop(HANDLE* handles, int count, DWORD timeout) {
 void EnumerateKeyValues(HKEY parent_key, const wchar_t* sub_key_name,
                         std::vector<std::wstring>* values) {
   DCHECK(values);
-  RegistryValueIterator url_list(parent_key, sub_key_name);
+  base::win::RegistryValueIterator url_list(parent_key, sub_key_name);
   while (url_list.Valid()) {
     values->push_back(url_list.Value());
     ++url_list;
diff --git a/net/base/platform_mime_util_win.cc b/net/base/platform_mime_util_win.cc
index bffb81a3b3cbe983ef0d331e5e42934e32aa28a6..b93008bc056146e11eed0c178e17b6f7de2873ba 100644
--- a/net/base/platform_mime_util_win.cc
+++ b/net/base/platform_mime_util_win.cc
@@ -6,8 +6,8 @@
 
 #include "net/base/platform_mime_util.h"
 
-#include "base/registry.h"
 #include "base/utf_string_conversions.h"
+#include "base/win/registry.h"
 
 namespace net {
 
@@ -16,8 +16,8 @@ bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension(
   // check windows registry for file extension's mime type (registry key
   // names are not case-sensitive).
   std::wstring value, key = L"." + ext;
-  RegKey(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ).ReadValue(L"Content Type",
-                                                             &value);
+  base::win::RegKey(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ).ReadValue(
+      L"Content Type", &value);
   if (!value.empty()) {
     *result = WideToUTF8(value);
     return true;
@@ -28,8 +28,8 @@ bool PlatformMimeUtil::GetPlatformMimeTypeFromExtension(
 bool PlatformMimeUtil::GetPreferredExtensionForMimeType(
     const std::string& mime_type, FilePath::StringType* ext) const {
   std::wstring key(L"MIME\\Database\\Content Type\\" + UTF8ToWide(mime_type));
-  if (!RegKey(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ).ReadValue(L"Extension",
-                                                                  ext)) {
+  if (!base::win::RegKey(HKEY_CLASSES_ROOT, key.c_str(), KEY_READ).ReadValue(
+          L"Extension", ext)) {
     return false;
   }
   // Strip off the leading dot, this should always be the case.
diff --git a/net/base/ssl_config_service_win.cc b/net/base/ssl_config_service_win.cc
index 82f44bfd5639dad9b443913805a4e81b8c5f72fe..14c4d249a37546817bb944454af39b349aac48ce 100644
--- a/net/base/ssl_config_service_win.cc
+++ b/net/base/ssl_config_service_win.cc
@@ -4,10 +4,11 @@
 
 #include "net/base/ssl_config_service_win.h"
 
-#include "base/registry.h"
+#include "base/win/registry.h"
 
 using base::TimeDelta;
 using base::TimeTicks;
+using base::win::RegKey;
 
 namespace net {
 
diff --git a/net/proxy/proxy_config_service_win.cc b/net/proxy/proxy_config_service_win.cc
index 1cd8a8c7a32d8105f8a43f086f48bc1ebcb0dac6..d0a387fd53b7914a856dc978ef04e11ae2afa4c7 100644
--- a/net/proxy/proxy_config_service_win.cc
+++ b/net/proxy/proxy_config_service_win.cc
@@ -8,11 +8,11 @@
 #include <winhttp.h>
 
 #include "base/logging.h"
-#include "base/registry.h"
 #include "base/scoped_ptr.h"
 #include "base/string_tokenizer.h"
 #include "base/string_util.h"
 #include "base/stl_util-inl.h"
+#include "base/win/registry.h"
 #include "net/base/net_errors.h"
 #include "net/proxy/proxy_config.h"
 
@@ -61,7 +61,7 @@ class ProxyConfigServiceWin::KeyEntry {
   }
 
  private:
-  RegKey key_;
+  base::win::RegKey key_;
   base::ObjectWatcher watcher_;
 };
 
diff --git a/sandbox/src/eat_resolver.cc b/sandbox/src/eat_resolver.cc
index d4f6e8336a86be42c656d89faf4efd4d450974ad..f0570069b2f611c67a455f8e17d9daddd255f345 100644
--- a/sandbox/src/eat_resolver.cc
+++ b/sandbox/src/eat_resolver.cc
@@ -4,7 +4,7 @@
 
 #include "sandbox/src/eat_resolver.h"
 
-#include "base/pe_image.h"
+#include "base/win/pe_image.h"
 #include "sandbox/src/sandbox_nt_util.h"
 
 namespace sandbox {
@@ -64,7 +64,7 @@ NTSTATUS EatResolverThunk::ResolveTarget(const void* module,
   if (!module)
     return STATUS_INVALID_PARAMETER;
 
-  PEImage pe(module);
+  base::win::PEImage pe(module);
   if (!pe.VerifyMagic())
     return STATUS_INVALID_IMAGE_FORMAT;
 
diff --git a/sandbox/src/interception.cc b/sandbox/src/interception.cc
index 28edf2c7ad24995e7390851fc39cf3a9091bef2b..003ebd840375f1af1c476b82c58b44d10614a90b 100644
--- a/sandbox/src/interception.cc
+++ b/sandbox/src/interception.cc
@@ -10,8 +10,8 @@
 #include "sandbox/src/interception.h"
 
 #include "base/logging.h"
-#include "base/pe_image.h"
 #include "base/scoped_ptr.h"
+#include "base/win/pe_image.h"
 #include "sandbox/src/interception_internal.h"
 #include "sandbox/src/interceptors.h"
 #include "sandbox/src/sandbox.h"
@@ -411,7 +411,7 @@ bool InterceptionManager::PatchClientFunctions(DllInterceptionData* thunks,
   if (!ntdll_base)
     return false;
 
-  PEImage ntdll_image(ntdll_base);
+  base::win::PEImage ntdll_image(ntdll_base);
 
   // Bypass purify's interception.
   wchar_t* loader_get = reinterpret_cast<wchar_t*>(
diff --git a/sandbox/src/policy_broker.cc b/sandbox/src/policy_broker.cc
index ff6766772caec1ca67898af51672e672f7acc4b6..0a63750668308d6cfb5f789b99dcd453bac6f442 100644
--- a/sandbox/src/policy_broker.cc
+++ b/sandbox/src/policy_broker.cc
@@ -7,7 +7,7 @@
 #include "sandbox/src/policy_broker.h"
 
 #include "base/logging.h"
-#include "base/pe_image.h"
+#include "base/win/pe_image.h"
 #include "base/win/windows_version.h"
 #include "sandbox/src/interception.h"
 #include "sandbox/src/interceptors.h"
@@ -41,7 +41,7 @@ SANDBOX_INTERCEPT NtExports g_nt;
 
 bool SetupNtdllImports(TargetProcess *child) {
   HMODULE ntdll = ::GetModuleHandle(kNtdllName);
-  PEImage ntdll_image(ntdll);
+  base::win::PEImage ntdll_image(ntdll);
 
   // Bypass purify's interception.
   wchar_t* loader_get = reinterpret_cast<wchar_t*>(
diff --git a/sandbox/src/resolver.cc b/sandbox/src/resolver.cc
index 7ed02e48e86db6a3171d225cda7ca47f0418c9c2..295bfb2ec4ba3585cb69f776165e3eb04d6222b8 100644
--- a/sandbox/src/resolver.cc
+++ b/sandbox/src/resolver.cc
@@ -4,7 +4,7 @@
 
 #include "sandbox/src/resolver.h"
 
-#include "base/pe_image.h"
+#include "base/win/pe_image.h"
 #include "sandbox/src/sandbox_nt_util.h"
 
 namespace sandbox {
@@ -47,7 +47,7 @@ NTSTATUS ResolverThunk::ResolveInterceptor(const void* interceptor_module,
   if (!interceptor_module)
     return STATUS_INVALID_PARAMETER;
 
-  PEImage pe(interceptor_module);
+  base::win::PEImage pe(interceptor_module);
   if (!pe.VerifyMagic())
     return STATUS_INVALID_IMAGE_FORMAT;
 
diff --git a/sandbox/src/sandbox_nt_util.cc b/sandbox/src/sandbox_nt_util.cc
index 89da4e0188dc6255f8ad5c0a3772266ad1fee7dd..20035b335faee11df38c02677cba0224c37c6bd4 100644
--- a/sandbox/src/sandbox_nt_util.cc
+++ b/sandbox/src/sandbox_nt_util.cc
@@ -4,7 +4,7 @@
 
 #include "sandbox/src/sandbox_nt_util.h"
 
-#include "base/pe_image.h"
+#include "base/win/pe_image.h"
 #include "sandbox/src/sandbox_factory.h"
 #include "sandbox/src/target_services.h"
 
@@ -357,7 +357,7 @@ UNICODE_STRING* GetImageInfoFromModule(HMODULE module, uint32* flags) {
   __try {
     do {
       *flags = 0;
-      PEImage pe(module);
+      base::win::PEImage pe(module);
 
       if (!pe.VerifyMagic())
         break;
diff --git a/sandbox/src/service_resolver.cc b/sandbox/src/service_resolver.cc
index 728555ea8190f10dfad62879fe86909fcf45ec64..79579a0485bcc14c109d5a480b17eabe2bca1e9f 100644
--- a/sandbox/src/service_resolver.cc
+++ b/sandbox/src/service_resolver.cc
@@ -5,7 +5,7 @@
 #include "sandbox/src/service_resolver.h"
 
 #include "base/logging.h"
-#include "base/pe_image.h"
+#include "base/win/pe_image.h"
 
 namespace sandbox {
 
@@ -28,7 +28,7 @@ NTSTATUS ServiceResolverThunk::ResolveTarget(const void* module,
   if (NULL == module)
     return STATUS_UNSUCCESSFUL;
 
-  PEImage module_image(module);
+  base::win::PEImage module_image(module);
   *address = module_image.GetProcAddress(function_name);
 
   if (NULL == *address) {
diff --git a/sandbox/src/sidestep_resolver.cc b/sandbox/src/sidestep_resolver.cc
index 74409a8c9493e311ec0b89d89ce7783b96594597..0a2803cb333170bfa9aa9b708ce16aedafefa8dc 100644
--- a/sandbox/src/sidestep_resolver.cc
+++ b/sandbox/src/sidestep_resolver.cc
@@ -4,7 +4,7 @@
 
 #include "sandbox/src/sidestep_resolver.h"
 
-#include "base/pe_image.h"
+#include "base/win/pe_image.h"
 #include "sandbox/src/sandbox_nt_util.h"
 #include "sandbox/src/sidestep/preamble_patcher.h"
 
@@ -191,7 +191,7 @@ bool SmartSidestepResolverThunk::IsInternalCall(const void* base,
   DCHECK_NT(base);
   DCHECK_NT(return_address);
 
-  PEImage pe(base);
+  base::win::PEImage pe(base);
   if (pe.GetImageSectionFromAddr(return_address))
     return true;
   return false;
diff --git a/sandbox/src/target_process.cc b/sandbox/src/target_process.cc
index a9848c5adb6b3493b897390ab3e2ebc50e3c878b..134194941349b540b106ab992ff62d65c1b80c70 100644
--- a/sandbox/src/target_process.cc
+++ b/sandbox/src/target_process.cc
@@ -5,8 +5,8 @@
 #include "sandbox/src/target_process.h"
 
 #include "base/basictypes.h"
-#include "base/pe_image.h"
 #include "base/scoped_ptr.h"
+#include "base/win/pe_image.h"
 #include "sandbox/src/crosscall_server.h"
 #include "sandbox/src/crosscall_client.h"
 #include "sandbox/src/policy_low_level.h"
@@ -54,7 +54,7 @@ void* GetBaseAddress(const wchar_t* exe_name, void* entry_point) {
   if (NULL == exe)
     return exe;
 
-  PEImage pe(exe);
+  base::win::PEImage pe(exe);
   if (!pe.VerifyMagic()) {
     ::FreeLibrary(exe);
     return exe;
diff --git a/webkit/glue/plugins/plugin_list_win.cc b/webkit/glue/plugins/plugin_list_win.cc
index e515e10f2cf3a0dcc4bd02e568186871cecea876..486926251b8cb48774389c3a4d9e8824307a2c25 100644
--- a/webkit/glue/plugins/plugin_list_win.cc
+++ b/webkit/glue/plugins/plugin_list_win.cc
@@ -12,11 +12,11 @@
 #include "base/command_line.h"
 #include "base/file_util.h"
 #include "base/path_service.h"
-#include "base/registry.h"
 #include "base/scoped_ptr.h"
 #include "base/string_number_conversions.h"
 #include "base/string_split.h"
 #include "base/string_util.h"
+#include "base/win/registry.h"
 #include "webkit/glue/plugins/plugin_constants_win.h"
 #include "webkit/glue/plugins/plugin_lib.h"
 #include "webkit/glue/webkit_glue.h"
@@ -67,7 +67,7 @@ bool GetInstalledPath(const TCHAR* app, FilePath* out) {
   reg_path.append(L"\\");
   reg_path.append(app);
 
-  RegKey key(HKEY_LOCAL_MACHINE, reg_path.c_str(), KEY_READ);
+  base::win::RegKey key(HKEY_LOCAL_MACHINE, reg_path.c_str(), KEY_READ);
   std::wstring path;
   if (key.ReadValue(kRegistryPath, &path)) {
     *out = FilePath(path);
@@ -82,13 +82,13 @@ void GetPluginsInRegistryDirectory(
     HKEY root_key,
     const std::wstring& registry_folder,
     std::set<FilePath>* plugin_dirs) {
-  for (RegistryKeyIterator iter(root_key, registry_folder.c_str());
+  for (base::win::RegistryKeyIterator iter(root_key, registry_folder.c_str());
        iter.Valid(); ++iter) {
     // Use the registry to gather plugin across the file system.
     std::wstring reg_path = registry_folder;
     reg_path.append(L"\\");
     reg_path.append(iter.Name());
-    RegKey key(root_key, reg_path.c_str(), KEY_READ);
+    base::win::RegKey key(root_key, reg_path.c_str(), KEY_READ);
 
     std::wstring path;
     if (key.ReadValue(kRegistryPath, &path))
@@ -99,11 +99,12 @@ void GetPluginsInRegistryDirectory(
 // Enumerate through the registry key to find all installed FireFox paths.
 // FireFox 3 beta and version 2 can coexist. See bug: 1025003
 void GetFirefoxInstalledPaths(std::vector<FilePath>* out) {
-  RegistryKeyIterator it(HKEY_LOCAL_MACHINE, kRegistryFirefoxInstalled);
+  base::win::RegistryKeyIterator it(HKEY_LOCAL_MACHINE,
+                                    kRegistryFirefoxInstalled);
   for (; it.Valid(); ++it) {
     std::wstring full_path = std::wstring(kRegistryFirefoxInstalled) + L"\\" +
                              it.Name() + L"\\Main";
-    RegKey key(HKEY_LOCAL_MACHINE, full_path.c_str(), KEY_READ);
+    base::win::RegKey key(HKEY_LOCAL_MACHINE, full_path.c_str(), KEY_READ);
     std::wstring install_dir;
     if (!key.ReadValue(L"Install Directory", &install_dir))
       continue;
@@ -180,7 +181,8 @@ void GetWindowsMediaDirectory(std::set<FilePath>* plugin_dirs) {
 void GetJavaDirectory(std::set<FilePath>* plugin_dirs) {
   // Load the new NPAPI Java plugin
   // 1. Open the main JRE key under HKLM
-  RegKey java_key(HKEY_LOCAL_MACHINE, kRegistryJava, KEY_QUERY_VALUE);
+  base::win::RegKey java_key(HKEY_LOCAL_MACHINE, kRegistryJava,
+                             KEY_QUERY_VALUE);
 
   // 2. Read the current Java version
   std::wstring java_version;
diff --git a/webkit/glue/plugins/webplugin_delegate_impl_win.cc b/webkit/glue/plugins/webplugin_delegate_impl_win.cc
index 867727f067859d9e2b9c13871592ab0260bb29b8..da7a68fa9cccf5665367a95bc2a4110fb5d294b0 100644
--- a/webkit/glue/plugins/webplugin_delegate_impl_win.cc
+++ b/webkit/glue/plugins/webplugin_delegate_impl_win.cc
@@ -13,12 +13,12 @@
 #include "base/lazy_instance.h"
 #include "base/message_loop.h"
 #include "base/metrics/stats_counters.h"
-#include "base/registry.h"
 #include "base/scoped_ptr.h"
 #include "base/string_number_conversions.h"
 #include "base/string_split.h"
 #include "base/string_util.h"
 #include "base/stringprintf.h"
+#include "base/win/registry.h"
 #include "base/win/windows_version.h"
 #include "skia/ext/platform_canvas.h"
 #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h"
@@ -416,7 +416,7 @@ bool WebPluginDelegateImpl::PlatformInitialize() {
   // for the rest patch this function.
   if ((quirks_ & PLUGIN_QUIRK_PATCH_REGENUMKEYEXW) &&
       base::win::GetVersion() == base::win::VERSION_XP &&
-      !RegKey().Open(HKEY_LOCAL_MACHINE,
+      !base::win::RegKey().Open(HKEY_LOCAL_MACHINE,
           L"SOFTWARE\\Microsoft\\MediaPlayer\\ShimInclusionList\\chrome.exe",
           KEY_READ) &&
       !g_iat_patch_reg_enum_key_ex_w.Pointer()->is_patched()) {