Chromium Code Reviews| Index: chrome/app/chrome_breakpad_client.cc |
| diff --git a/chrome/app/chrome_breakpad_client.cc b/chrome/app/chrome_breakpad_client.cc |
| index 0c5d3d1a46bb4bac72a7c077eb4c768b452fef03..00e75ccbab5e8d6e0a5282937dfb734d5f689d84 100644 |
| --- a/chrome/app/chrome_breakpad_client.cc |
| +++ b/chrome/app/chrome_breakpad_client.cc |
| @@ -10,10 +10,12 @@ |
| #include "base/logging.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/path_service.h" |
| +#include "base/strings/string_split.h" |
| #include "base/strings/utf_string_conversions.h" |
| #include "chrome/common/chrome_paths.h" |
| #include "chrome/common/chrome_switches.h" |
| #include "chrome/common/crash_keys.h" |
| +#include "chrome/common/env_vars.h" |
| #if defined(OS_WIN) |
| #include "base/file_version_info.h" |
| @@ -80,6 +82,42 @@ void ChromeBreakpadClient::GetProductNameAndVersion( |
| *version = base::ASCIIToUTF16("0.0.0.0-devel"); |
| } |
| } |
| + |
| +bool ChromeBreakpadClient::ShouldShowRestartDialog(base::string16* title, |
| + base::string16* message, |
| + bool* is_rtl_locale) { |
| + scoped_ptr<base::Environment> env(base::Environment::Create()); |
| + if (!env->HasVar(env_vars::kShowRestart) || |
| + !env->HasVar(env_vars::kRestartInfo)) { |
|
marja
2013/07/19 08:20:33
Nit: no { } for one-line bodies, even if the "if"
jochen (gone - plz use gerrit)
2013/07/19 08:23:51
where's that rule from?
marja
2013/07/19 08:31:56
Hmmh! I might be misinformed! Atm the style guide
|
| + return false; |
| + } |
| + |
| + std::string restart_info; |
| + env->GetVar(env_vars::kRestartInfo, &restart_info); |
| + |
| + // The CHROME_RESTART var contains the dialog strings separated by '|'. |
| + // See ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment() |
| + // for details. |
| + std::vector<std::string> dlg_strings; |
| + base::SplitString(restart_info, '|', &dlg_strings); |
| + |
| + if (dlg_strings.size() < 3) |
| + return false; |
| + |
| + *title = base::ASCIIToUTF16(dlg_strings[0]); |
| + *message = base::ASCIIToUTF16(dlg_strings[0]); |
| + *is_rtl_locale = dlg_strings[2] == env_vars::kRtlLocale; |
| + return true; |
| +} |
| + |
| +bool ChromeBreakpadClient::AboutToRestart() { |
| + scoped_ptr<base::Environment> env(base::Environment::Create()); |
| + if (!env->HasVar(env_vars::kRestartInfo)) |
| + return false; |
| + |
| + env->SetVar(env_vars::kShowRestart, "1"); |
| + return true; |
| +} |
| #endif |
| #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS) |
| @@ -127,4 +165,9 @@ size_t ChromeBreakpadClient::RegisterCrashKeys() { |
| return crash_keys::RegisterChromeCrashKeys(); |
| } |
| +bool ChromeBreakpadClient::IsRunningUnattended() { |
| + scoped_ptr<base::Environment> env(base::Environment::Create()); |
| + return env->HasVar(env_vars::kHeadless); |
| +} |
| + |
| } // namespace chrome |