Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3924)

Unified Diff: chrome/browser/importer/firefox_importer_utils_win.cc

Issue 2403001: Remove deprecated versions of Registry functions. (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: fix typo Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/registry.h ('k') | chrome/browser/importer/ie_importer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/importer/firefox_importer_utils_win.cc
diff --git a/chrome/browser/importer/firefox_importer_utils_win.cc b/chrome/browser/importer/firefox_importer_utils_win.cc
index 370ec6818644344323d8dc556debb4cd599227b6..548ecd1a23f1027932ca824186b0cff7275c067b 100644
--- a/chrome/browser/importer/firefox_importer_utils_win.cc
+++ b/chrome/browser/importer/firefox_importer_utils_win.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.
@@ -28,9 +28,11 @@ int GetCurrentFirefoxMajorVersionFromRegistry() {
// written under HKLM\Mozilla. Otherwise it the keys will be written under
// HKCU\Mozilla.
for (int i = 0; i < arraysize(kFireFoxRegistryPaths); ++i) {
- bool result = ReadFromRegistry(kFireFoxRegistryPaths[i],
- L"Software\\Mozilla\\Mozilla Firefox",
- L"CurrentVersion", ver_buffer, &ver_buffer_length);
+ RegKey reg_key(kFireFoxRegistryPaths[i],
+ L"Software\\Mozilla\\Mozilla Firefox");
+
+ bool result = reg_key.ReadValue(L"CurrentVersion", ver_buffer,
+ &ver_buffer_length, NULL);
if (!result)
continue;
highest_version = std::max(highest_version, _wtoi(ver_buffer));
@@ -43,15 +45,16 @@ std::wstring GetFirefoxInstallPathFromRegistry() {
std::wstring registry_path = L"Software\\Mozilla\\Mozilla Firefox";
TCHAR buffer[MAX_PATH];
DWORD buffer_length = sizeof(buffer);
- bool result;
- result = ReadFromRegistry(HKEY_LOCAL_MACHINE, registry_path.c_str(),
- L"CurrentVersion", buffer, &buffer_length);
+ RegKey reg_key(HKEY_LOCAL_MACHINE, registry_path.c_str());
+ 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);
- result = ReadFromRegistry(HKEY_LOCAL_MACHINE, registry_path.c_str(),
- L"Install Directory", buffer, &buffer_length);
+ reg_key = RegKey(HKEY_LOCAL_MACHINE, registry_path.c_str());
+ result = reg_key.ReadValue(L"Install Directory", buffer,
+ &buffer_length, NULL);
if (!result)
return std::wstring();
return buffer;
« no previous file with comments | « base/registry.h ('k') | chrome/browser/importer/ie_importer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698