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 11 matching lines...) Expand all Loading... |
22 #include "chrome/common/env_vars.h" | 22 #include "chrome/common/env_vars.h" |
23 #include "chrome/installer/util/google_update_settings.h" | 23 #include "chrome/installer/util/google_update_settings.h" |
24 | 24 |
25 #if defined(OS_WIN) | 25 #if defined(OS_WIN) |
26 #include <windows.h> | 26 #include <windows.h> |
27 | 27 |
28 #include "base/file_version_info.h" | 28 #include "base/file_version_info.h" |
29 #include "base/win/registry.h" | 29 #include "base/win/registry.h" |
30 #include "chrome/installer/util/google_chrome_sxs_distribution.h" | 30 #include "chrome/installer/util/google_chrome_sxs_distribution.h" |
31 #include "chrome/installer/util/install_util.h" | 31 #include "chrome/installer/util/install_util.h" |
| 32 #include "chrome/installer/util/util_constants.h" |
32 #include "policy/policy_constants.h" | 33 #include "policy/policy_constants.h" |
33 #endif | 34 #endif |
34 | 35 |
35 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS) | 36 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS) |
36 #include "chrome/browser/crash_upload_list.h" | 37 #include "chrome/browser/crash_upload_list.h" |
37 #include "chrome/common/chrome_version_info_posix.h" | 38 #include "chrome/common/chrome_version_info_posix.h" |
38 #endif | 39 #endif |
39 | 40 |
40 #if defined(OS_POSIX) | 41 #if defined(OS_POSIX) |
41 #include "base/debug/dump_without_crashing.h" | 42 #include "base/debug/dump_without_crashing.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 version->append(base::ASCIIToUTF16("-devel")); | 120 version->append(base::ASCIIToUTF16("-devel")); |
120 | 121 |
121 *product_name = version_info->product_short_name(); | 122 *product_name = version_info->product_short_name(); |
122 *special_build = version_info->special_build(); | 123 *special_build = version_info->special_build(); |
123 } else { | 124 } else { |
124 // No version info found. Make up the values. | 125 // No version info found. Make up the values. |
125 *product_name = base::ASCIIToUTF16("Chrome"); | 126 *product_name = base::ASCIIToUTF16("Chrome"); |
126 *version = base::ASCIIToUTF16("0.0.0.0-devel"); | 127 *version = base::ASCIIToUTF16("0.0.0.0-devel"); |
127 } | 128 } |
128 | 129 |
129 std::wstring channel_string; | |
130 GoogleUpdateSettings::GetChromeChannelAndModifiers( | 130 GoogleUpdateSettings::GetChromeChannelAndModifiers( |
131 !GetIsPerUserInstall(exe_path), &channel_string); | 131 !GetIsPerUserInstall(exe_path), channel_name); |
132 *channel_name = base::WideToUTF16(channel_string); | |
133 } | 132 } |
134 | 133 |
135 bool ChromeBreakpadClient::ShouldShowRestartDialog(base::string16* title, | 134 bool ChromeBreakpadClient::ShouldShowRestartDialog(base::string16* title, |
136 base::string16* message, | 135 base::string16* message, |
137 bool* is_rtl_locale) { | 136 bool* is_rtl_locale) { |
138 scoped_ptr<base::Environment> env(base::Environment::Create()); | 137 scoped_ptr<base::Environment> env(base::Environment::Create()); |
139 if (!env->HasVar(env_vars::kShowRestart) || | 138 if (!env->HasVar(env_vars::kShowRestart) || |
140 !env->HasVar(env_vars::kRestartInfo) || | 139 !env->HasVar(env_vars::kRestartInfo) || |
141 env->HasVar(env_vars::kMetroConnected)) { | 140 env->HasVar(env_vars::kMetroConnected)) { |
142 return false; | 141 return false; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 return false; | 177 return false; |
179 | 178 |
180 return true; | 179 return true; |
181 } | 180 } |
182 | 181 |
183 bool ChromeBreakpadClient::GetIsPerUserInstall(const base::FilePath& exe_path) { | 182 bool ChromeBreakpadClient::GetIsPerUserInstall(const base::FilePath& exe_path) { |
184 return InstallUtil::IsPerUserInstall(exe_path.value().c_str()); | 183 return InstallUtil::IsPerUserInstall(exe_path.value().c_str()); |
185 } | 184 } |
186 | 185 |
187 bool ChromeBreakpadClient::GetShouldDumpLargerDumps(bool is_per_user_install) { | 186 bool ChromeBreakpadClient::GetShouldDumpLargerDumps(bool is_per_user_install) { |
188 base::string16 channel_name(base::WideToUTF16( | 187 base::string16 channel_name = |
189 GoogleUpdateSettings::GetChromeChannel(!is_per_user_install))); | 188 GoogleUpdateSettings::GetChromeChannel(!is_per_user_install); |
190 | 189 |
191 // Capture more detail in crash dumps for beta and dev channel builds. | 190 // Capture more detail in crash dumps for beta and dev channel builds. |
192 if (channel_name == base::ASCIIToUTF16("dev") || | 191 return (channel_name == installer::kChromeChannelDev || |
193 channel_name == base::ASCIIToUTF16("beta") || | 192 channel_name == installer::kChromeChannelBeta || |
194 channel_name == GoogleChromeSxSDistribution::ChannelName()) | 193 channel_name == GoogleChromeSxSDistribution::ChannelName()); |
195 return true; | |
196 return false; | |
197 } | 194 } |
198 | 195 |
199 int ChromeBreakpadClient::GetResultCodeRespawnFailed() { | 196 int ChromeBreakpadClient::GetResultCodeRespawnFailed() { |
200 return chrome::RESULT_CODE_RESPAWN_FAILED; | 197 return chrome::RESULT_CODE_RESPAWN_FAILED; |
201 } | 198 } |
202 | 199 |
203 void ChromeBreakpadClient::InitBrowserCrashDumpsRegKey() { | 200 void ChromeBreakpadClient::InitBrowserCrashDumpsRegKey() { |
204 DCHECK(g_browser_crash_dump_regkey == NULL); | 201 DCHECK(g_browser_crash_dump_regkey == NULL); |
205 | 202 |
206 base::win::RegKey regkey; | 203 base::win::RegKey regkey; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 | 270 |
274 base::win::RegKey hkcu_policy_key(HKEY_CURRENT_USER, | 271 base::win::RegKey hkcu_policy_key(HKEY_CURRENT_USER, |
275 policy::kRegistryChromePolicyKey, KEY_READ); | 272 policy::kRegistryChromePolicyKey, KEY_READ); |
276 if (hkcu_policy_key.ReadValueDW(key_name.c_str(), &value) == ERROR_SUCCESS) { | 273 if (hkcu_policy_key.ReadValueDW(key_name.c_str(), &value) == ERROR_SUCCESS) { |
277 *breakpad_enabled = value != 0; | 274 *breakpad_enabled = value != 0; |
278 return true; | 275 return true; |
279 } | 276 } |
280 | 277 |
281 return false; | 278 return false; |
282 } | 279 } |
283 #endif | 280 #endif // defined(OS_WIN) |
284 | 281 |
285 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS) | 282 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS) |
286 void ChromeBreakpadClient::GetProductNameAndVersion(std::string* product_name, | 283 void ChromeBreakpadClient::GetProductNameAndVersion(std::string* product_name, |
287 std::string* version) { | 284 std::string* version) { |
288 DCHECK(product_name); | 285 DCHECK(product_name); |
289 DCHECK(version); | 286 DCHECK(version); |
290 #if defined(OS_ANDROID) | 287 #if defined(OS_ANDROID) |
291 *product_name = "Chrome_Android"; | 288 *product_name = "Chrome_Android"; |
292 #elif defined(OS_CHROMEOS) | 289 #elif defined(OS_CHROMEOS) |
293 *product_name = "Chrome_ChromeOS"; | 290 *product_name = "Chrome_ChromeOS"; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 bool ChromeBreakpadClient::EnableBreakpadForProcess( | 369 bool ChromeBreakpadClient::EnableBreakpadForProcess( |
373 const std::string& process_type) { | 370 const std::string& process_type) { |
374 return process_type == switches::kRendererProcess || | 371 return process_type == switches::kRendererProcess || |
375 process_type == switches::kPluginProcess || | 372 process_type == switches::kPluginProcess || |
376 process_type == switches::kPpapiPluginProcess || | 373 process_type == switches::kPpapiPluginProcess || |
377 process_type == switches::kZygoteProcess || | 374 process_type == switches::kZygoteProcess || |
378 process_type == switches::kGpuProcess; | 375 process_type == switches::kGpuProcess; |
379 } | 376 } |
380 | 377 |
381 } // namespace chrome | 378 } // namespace chrome |
OLD | NEW |