| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/app/chrome_breakpad_client.h" | 5 #include "chrome/app/chrome_breakpad_client.h" |
| 6 | 6 |
| 7 #include "base/atomicops.h" | 7 #include "base/atomicops.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/environment.h" | 9 #include "base/environment.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 sizeof(value_dword)); | 260 sizeof(value_dword)); |
| 261 } | 261 } |
| 262 } | 262 } |
| 263 | 263 |
| 264 bool ChromeBreakpadClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) { | 264 bool ChromeBreakpadClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) { |
| 265 // Determine whether configuration management allows loading the crash reporter. | 265 // Determine whether configuration management allows loading the crash reporter. |
| 266 // Since the configuration management infrastructure is not initialized at this | 266 // Since the configuration management infrastructure is not initialized at this |
| 267 // point, we read the corresponding registry key directly. The return status | 267 // point, we read the corresponding registry key directly. The return status |
| 268 // indicates whether policy data was successfully read. If it is true, | 268 // indicates whether policy data was successfully read. If it is true, |
| 269 // |breakpad_enabled| contains the value set by policy. | 269 // |breakpad_enabled| contains the value set by policy. |
| 270 string16 key_name = UTF8ToUTF16(policy::key::kMetricsReportingEnabled); | 270 base::string16 key_name = UTF8ToUTF16(policy::key::kMetricsReportingEnabled); |
| 271 DWORD value = 0; | 271 DWORD value = 0; |
| 272 base::win::RegKey hklm_policy_key(HKEY_LOCAL_MACHINE, | 272 base::win::RegKey hklm_policy_key(HKEY_LOCAL_MACHINE, |
| 273 policy::kRegistryChromePolicyKey, KEY_READ); | 273 policy::kRegistryChromePolicyKey, KEY_READ); |
| 274 if (hklm_policy_key.ReadValueDW(key_name.c_str(), &value) == ERROR_SUCCESS) { | 274 if (hklm_policy_key.ReadValueDW(key_name.c_str(), &value) == ERROR_SUCCESS) { |
| 275 *breakpad_enabled = value != 0; | 275 *breakpad_enabled = value != 0; |
| 276 return true; | 276 return true; |
| 277 } | 277 } |
| 278 | 278 |
| 279 base::win::RegKey hkcu_policy_key(HKEY_CURRENT_USER, | 279 base::win::RegKey hkcu_policy_key(HKEY_CURRENT_USER, |
| 280 policy::kRegistryChromePolicyKey, KEY_READ); | 280 policy::kRegistryChromePolicyKey, KEY_READ); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 bool ChromeBreakpadClient::EnableBreakpadForProcess( | 377 bool ChromeBreakpadClient::EnableBreakpadForProcess( |
| 378 const std::string& process_type) { | 378 const std::string& process_type) { |
| 379 return process_type == switches::kRendererProcess || | 379 return process_type == switches::kRendererProcess || |
| 380 process_type == switches::kPluginProcess || | 380 process_type == switches::kPluginProcess || |
| 381 process_type == switches::kPpapiPluginProcess || | 381 process_type == switches::kPpapiPluginProcess || |
| 382 process_type == switches::kZygoteProcess || | 382 process_type == switches::kZygoteProcess || |
| 383 process_type == switches::kGpuProcess; | 383 process_type == switches::kGpuProcess; |
| 384 } | 384 } |
| 385 | 385 |
| 386 } // namespace chrome | 386 } // namespace chrome |
| OLD | NEW |