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

Unified Diff: chrome/app/chrome_breakpad_client.cc

Issue 27031002: Move checking of configured policy on win to breakpad client (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 years, 2 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 | « chrome/app/chrome_breakpad_client.h ('k') | chrome/app/chrome_breakpad_client_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/chrome_breakpad_client.cc
diff --git a/chrome/app/chrome_breakpad_client.cc b/chrome/app/chrome_breakpad_client.cc
index 81c20cf0bccd1f8071766cbc38bb68f54a522045..d8f935986be3d27c8113d0da2e74d53ae00bd6a2 100644
--- a/chrome/app/chrome_breakpad_client.cc
+++ b/chrome/app/chrome_breakpad_client.cc
@@ -28,6 +28,7 @@
#include "base/win/registry.h"
#include "chrome/installer/util/google_chrome_sxs_distribution.h"
#include "chrome/installer/util/install_util.h"
+#include "policy/policy_constants.h"
#endif
#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS)
@@ -257,6 +258,31 @@ void ChromeBreakpadClient::RecordCrashDumpAttempt(bool is_real_crash) {
sizeof(value_dword));
}
}
+
+bool ChromeBreakpadClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
+// Determine whether configuration management allows loading the crash reporter.
+// Since the configuration management infrastructure is not initialized at this
+// point, we read the corresponding registry key directly. The return status
+// indicates whether policy data was successfully read. If it is true,
+// |breakpad_enabled| contains the value set by policy.
+ string16 key_name = UTF8ToUTF16(policy::key::kMetricsReportingEnabled);
+ DWORD value = 0;
+ base::win::RegKey hklm_policy_key(HKEY_LOCAL_MACHINE,
+ policy::kRegistryChromePolicyKey, KEY_READ);
+ if (hklm_policy_key.ReadValueDW(key_name.c_str(), &value) == ERROR_SUCCESS) {
+ *breakpad_enabled = value != 0;
+ return true;
+ }
+
+ base::win::RegKey hkcu_policy_key(HKEY_CURRENT_USER,
+ policy::kRegistryChromePolicyKey, KEY_READ);
+ if (hkcu_policy_key.ReadValueDW(key_name.c_str(), &value) == ERROR_SUCCESS) {
+ *breakpad_enabled = value != 0;
+ return true;
+ }
+
+ return false;
+}
#endif
#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS)
« no previous file with comments | « chrome/app/chrome_breakpad_client.h ('k') | chrome/app/chrome_breakpad_client_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698