summaryrefslogtreecommitdiffstats
path: root/chrome/installer
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-14 02:13:43 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-14 02:13:43 +0000
commit87e70062789c3695762c0ddaca1a759e8834398a (patch)
tree613a0a5fb74bc0ca8417976788fcce2666753d23 /chrome/installer
parentb5ff342a5aca83396114933152ad5d644f536375 (diff)
downloadchromium_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/installer')
-rw-r--r--chrome/installer/setup/uninstall.cc2
-rw-r--r--chrome/installer/util/google_chrome_distribution.cc2
-rw-r--r--chrome/installer/util/install_util.cc4
-rw-r--r--chrome/installer/util/shell_util.cc16
4 files changed, 12 insertions, 12 deletions
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc
index 2d19ca4..f8c0482 100644
--- a/chrome/installer/setup/uninstall.cc
+++ b/chrome/installer/setup/uninstall.cc
@@ -72,7 +72,7 @@ bool CurrentUserHasDefaultBrowser(bool system_uninstall) {
std::wstring reg_key(ShellUtil::kRegStartMenuInternet);
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
reg_key.append(L"\\" + dist->GetApplicationName() + ShellUtil::kRegShellOpen);
- RegKey key(HKEY_LOCAL_MACHINE, reg_key.c_str());
+ RegKey key(HKEY_LOCAL_MACHINE, reg_key.c_str(), KEY_READ);
std::wstring reg_exe;
if (key.ReadValue(L"", &reg_exe) && reg_exe.length() > 2) {
std::wstring chrome_exe = installer::GetChromeInstallPath(system_uninstall);
diff --git a/chrome/installer/util/google_chrome_distribution.cc b/chrome/installer/util/google_chrome_distribution.cc
index 8a2069d..adb5b1a 100644
--- a/chrome/installer/util/google_chrome_distribution.cc
+++ b/chrome/installer/util/google_chrome_distribution.cc
@@ -412,7 +412,7 @@ std::wstring GoogleChromeDistribution::GetDistributionData(RegKey* key) {
sub_key.append(L"\\");
sub_key.append(product_guid());
- RegKey client_state_key(key->Handle(), sub_key.c_str());
+ 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/install_util.cc b/chrome/installer/util/install_util.cc
index a64a7cc..3ace4bf 100644
--- a/chrome/installer/util/install_util.cc
+++ b/chrome/installer/util/install_util.cc
@@ -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.
//
@@ -55,7 +55,7 @@ bool InstallUtil::ExecuteExeAsAdmin(const std::wstring& exe,
std::wstring InstallUtil::GetChromeUninstallCmd(bool system_install) {
HKEY root = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
- RegKey key(root, dist->GetUninstallRegPath().c_str());
+ RegKey key(root, dist->GetUninstallRegPath().c_str(), KEY_READ);
std::wstring uninstall_cmd;
key.ReadValue(installer_util::kUninstallStringField, &uninstall_cmd);
return uninstall_cmd;
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc
index 7d170d0..1655af7 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -191,7 +191,7 @@ class RegistryEntry {
// Checks if the current registry entry exists in HKLM registry and the value
// is same.
bool ExistsInHKLM() const {
- RegKey key(HKEY_LOCAL_MACHINE, _key_path.c_str());
+ RegKey key(HKEY_LOCAL_MACHINE, _key_path.c_str(), KEY_READ);
bool found = false;
if (_is_string) {
std::wstring read_value;
@@ -211,7 +211,7 @@ class RegistryEntry {
// Checks if the current registry entry exists in HKLM registry
// (only the name).
bool NameExistsInHKLM() const {
- RegKey key(HKEY_LOCAL_MACHINE, _key_path.c_str());
+ RegKey key(HKEY_LOCAL_MACHINE, _key_path.c_str(), KEY_READ);
bool found = false;
if (_is_string) {
std::wstring read_value;
@@ -303,7 +303,7 @@ bool ElevateAndRegisterChrome(const std::wstring& chrome_exe,
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
HKEY reg_root = InstallUtil::IsPerUserInstall(chrome_exe.c_str()) ?
HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE;
- RegKey key(reg_root, dist->GetUninstallRegPath().c_str());
+ RegKey key(reg_root, dist->GetUninstallRegPath().c_str(), KEY_READ);
key.ReadValue(installer_util::kUninstallStringField, &exe_path);
CommandLine command_line = CommandLine::FromString(exe_path);
exe_path = command_line.program();
@@ -349,7 +349,7 @@ bool AnotherUserHasDefaultBrowser(const std::wstring& chrome_exe) {
std::wstring reg_key(ShellUtil::kRegStartMenuInternet);
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
reg_key.append(L"\\" + dist->GetApplicationName() + ShellUtil::kRegShellOpen);
- RegKey key(HKEY_LOCAL_MACHINE, reg_key.c_str());
+ RegKey key(HKEY_LOCAL_MACHINE, reg_key.c_str(), KEY_READ);
std::wstring registry_chrome_exe;
if (!key.ReadValue(L"", &registry_chrome_exe) ||
registry_chrome_exe.length() < 2)
@@ -569,15 +569,15 @@ void ShellUtil::GetRegisteredBrowsers(std::map<std::wstring,
HKEY root = HKEY_LOCAL_MACHINE;
for (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());
+ RegKey capabilities(root, (key + L"\\Capabilities").c_str(), KEY_READ);
std::wstring name;
if (!capabilities.Valid() ||
!capabilities.ReadValue(L"ApplicationName", &name)) {
- RegKey base_key(root, key.c_str());
+ RegKey base_key(root, key.c_str(), KEY_READ);
if (!base_key.ReadValue(L"", &name))
continue;
}
- RegKey install_info(root, (key + L"\\InstallInfo").c_str());
+ RegKey install_info(root, (key + L"\\InstallInfo").c_str(), KEY_READ);
std::wstring command;
if (!install_info.Valid() ||
!install_info.ReadValue(L"ReinstallCommand", &command))
@@ -600,7 +600,7 @@ bool ShellUtil::GetUserSpecificDefaultBrowserSuffix(std::wstring* entry) {
std::wstring start_menu_entry(ShellUtil::kRegStartMenuInternet);
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
start_menu_entry.append(L"\\" + dist->GetApplicationName() + *entry);
- RegKey key(HKEY_LOCAL_MACHINE, start_menu_entry.c_str());
+ RegKey key(HKEY_LOCAL_MACHINE, start_menu_entry.c_str(), KEY_READ);
return key.Valid();
}