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

Unified Diff: chrome/browser/configuration_policy_provider_win.cc

Issue 3033030: [win] Don't initialize the crash reporter on windows if disabled by configuration management. (Closed) Base URL: ssh://mnissler@kea.muc/usr/local/google/home/mnissler/chrome/src/
Patch Set: Allow policy to force-enable metrics reporting. Created 10 years, 5 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
Index: chrome/browser/configuration_policy_provider_win.cc
diff --git a/chrome/browser/configuration_policy_provider_win.cc b/chrome/browser/configuration_policy_provider_win.cc
index d39adeef0dd5cdfe9ec2f287b70818d2950a14a9..a52c123e7fc98f4c6ec1cf0ffdf99701be43d705 100644
--- a/chrome/browser/configuration_policy_provider_win.cc
+++ b/chrome/browser/configuration_policy_provider_win.cc
@@ -13,14 +13,7 @@
#include "base/sys_string_conversions.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
-
-#if defined(GOOGLE_CHROME_BUILD)
-const wchar_t ConfigurationPolicyProviderWin::kPolicyRegistrySubKey[] =
- L"SOFTWARE\\Policies\\Google\\Chrome";
-#else
-const wchar_t ConfigurationPolicyProviderWin::kPolicyRegistrySubKey[] =
- L"SOFTWARE\\Policies\\Chromium";
-#endif
+#include "chrome/common/policy_constants.h"
ConfigurationPolicyProviderWin::ConfigurationPolicyProviderWin() {
}
@@ -30,7 +23,7 @@ bool ConfigurationPolicyProviderWin::GetRegistryPolicyString(
DWORD value_size = 0;
DWORD key_type = 0;
scoped_array<uint8> buffer;
- RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE, kPolicyRegistrySubKey);
+ RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE, policy::kRegistrySubKey);
if (hkcu_policy_key.ReadValue(value_name, 0, &value_size, &key_type)) {
if (key_type != REG_SZ)
return false;
@@ -42,7 +35,7 @@ bool ConfigurationPolicyProviderWin::GetRegistryPolicyString(
memset(buffer.get(), 0, value_size + 2);
hkcu_policy_key.ReadValue(value_name, buffer.get(), &value_size);
} else {
- RegKey hklm_policy_key(HKEY_CURRENT_USER, kPolicyRegistrySubKey);
+ RegKey hklm_policy_key(HKEY_CURRENT_USER, policy::kRegistrySubKey);
if (hklm_policy_key.ReadValue(value_name, 0, &value_size, &key_type)) {
if (key_type != REG_SZ)
return false;
@@ -65,13 +58,13 @@ bool ConfigurationPolicyProviderWin::GetRegistryPolicyString(
bool ConfigurationPolicyProviderWin::GetRegistryPolicyBoolean(
const wchar_t* value_name, bool* result) {
DWORD value;
- RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE, kPolicyRegistrySubKey);
+ RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE, policy::kRegistrySubKey);
if (hkcu_policy_key.ReadValueDW(value_name, &value)) {
*result = value != 0;
return true;
}
- RegKey hklm_policy_key(HKEY_CURRENT_USER, kPolicyRegistrySubKey);
+ RegKey hklm_policy_key(HKEY_CURRENT_USER, policy::kRegistrySubKey);
if (hklm_policy_key.ReadValueDW(value_name, &value)) {
*result = value != 0;
return true;
@@ -82,13 +75,13 @@ bool ConfigurationPolicyProviderWin::GetRegistryPolicyBoolean(
bool ConfigurationPolicyProviderWin::GetRegistryPolicyInteger(
const wchar_t* value_name, uint32* result) {
DWORD value;
- RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE, kPolicyRegistrySubKey);
+ RegKey hkcu_policy_key(HKEY_LOCAL_MACHINE, policy::kRegistrySubKey);
if (hkcu_policy_key.ReadValueDW(value_name, &value)) {
*result = value;
return true;
}
- RegKey hklm_policy_key(HKEY_CURRENT_USER, kPolicyRegistrySubKey);
+ RegKey hklm_policy_key(HKEY_CURRENT_USER, policy::kRegistrySubKey);
if (hklm_policy_key.ReadValueDW(value_name, &value)) {
*result = value;
return true;
@@ -134,4 +127,3 @@ bool ConfigurationPolicyProviderWin::Provide(
return true;
}
-

Powered by Google App Engine
This is Rietveld 408576698