diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-14 02:13:43 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-14 02:13:43 +0000 |
commit | 87e70062789c3695762c0ddaca1a759e8834398a (patch) | |
tree | 613a0a5fb74bc0ca8417976788fcce2666753d23 /chrome/browser/importer | |
parent | b5ff342a5aca83396114933152ad5d644f536375 (diff) | |
download | chromium_src-87e70062789c3695762c0ddaca1a759e8834398a.zip chromium_src-87e70062789c3695762c0ddaca1a759e8834398a.tar.gz chromium_src-87e70062789c3695762c0ddaca1a759e8834398a.tar.bz2 |
Cleanup Registry API: part 3.
- Remove the default arguments from the constructor.
- Add a empty constructor to handle the case of the default arguments were used.
BUG=44644
TEST=trybots
Review URL: http://codereview.chromium.org/3172009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56123 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/importer')
-rw-r--r-- | chrome/browser/importer/firefox_importer_utils_win.cc | 6 | ||||
-rw-r--r-- | chrome/browser/importer/ie_importer.cc | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/chrome/browser/importer/firefox_importer_utils_win.cc b/chrome/browser/importer/firefox_importer_utils_win.cc index 6887067..3200eb1 100644 --- a/chrome/browser/importer/firefox_importer_utils_win.cc +++ b/chrome/browser/importer/firefox_importer_utils_win.cc @@ -29,7 +29,7 @@ int GetCurrentFirefoxMajorVersionFromRegistry() { // HKCU\Mozilla. for (int i = 0; i < arraysize(kFireFoxRegistryPaths); ++i) { RegKey reg_key(kFireFoxRegistryPaths[i], - L"Software\\Mozilla\\Mozilla Firefox"); + L"Software\\Mozilla\\Mozilla Firefox", KEY_READ); bool result = reg_key.ReadValue(L"CurrentVersion", ver_buffer, &ver_buffer_length, NULL); @@ -45,14 +45,14 @@ 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()); + 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()); + 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 21b36d1..ab0a61c 100644 --- a/chrome/browser/importer/ie_importer.cc +++ b/chrome/browser/importer/ie_importer.cc @@ -462,7 +462,8 @@ bool IEImporter::GetFavoritesInfo(IEImporter::FavoritesInfo *info) { // The Link folder name is stored in the registry. DWORD buffer_length = sizeof(buffer); RegKey reg_key(HKEY_CURRENT_USER, - L"Software\\Microsoft\\Internet Explorer\\Toolbar"); + L"Software\\Microsoft\\Internet Explorer\\Toolbar", + KEY_READ); if (!reg_key.ReadValue(L"LinksFolderName", buffer, &buffer_length, NULL)) return false; info->links_folder = buffer; @@ -571,7 +572,7 @@ int IEImporter::CurrentIEVersion() const { wchar_t buffer[128]; DWORD buffer_length = sizeof(buffer); RegKey reg_key(HKEY_LOCAL_MACHINE, - L"Software\\Microsoft\\Internet Explorer"); + L"Software\\Microsoft\\Internet Explorer", KEY_READ); bool result = reg_key.ReadValue(L"Version", buffer, &buffer_length, NULL); version = (result ? _wtoi(buffer) : 0); } |