Chromium Code Reviews| Index: chrome/app/chrome_main_delegate.cc |
| diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc |
| index 7cf7a916cbb99ac662aa730bf933dd193c62d9a5..2b0b1dd50d319d394aa1b9370136aa56af9ecc34 100644 |
| --- a/chrome/app/chrome_main_delegate.cc |
| +++ b/chrome/app/chrome_main_delegate.cc |
| @@ -72,6 +72,7 @@ |
| #include "base/mac/foundation_util.h" |
| #include "chrome/app/chrome_main_mac.h" |
| #include "chrome/browser/mac/relauncher.h" |
| +#include "chrome/browser/shell_integration.h" |
| #include "chrome/common/mac/cfbundle_blocker.h" |
| #include "components/crash/content/app/crashpad.h" |
| #include "components/crash/core/common/objc_zombie.h" |
| @@ -695,6 +696,21 @@ void ChromeMainDelegate::InitMacCrashReporter( |
| << "Main application forbids --type, saw " << process_type; |
| } |
| } |
| + |
| +void ChromeMainDelegate::SetUpInstallerPreferences( |
| + const base::CommandLine& command_line) { |
| + const bool uma_setting = command_line.HasSwitch(switches::kEnableUserMetrics); |
| + const bool default_browser_setting = |
| + command_line.HasSwitch(switches::kSetDefaultBrowser); |
| + |
| + if (uma_setting) { |
|
grt (UTC plus 2)
2016/08/24 22:11:55
nit: omit braces for single-line conditionals like
Anna Zeng
2016/08/30 20:29:30
Done.
|
| + crash_reporter::SetUploadsEnabled(uma_setting); |
| + } |
| + |
| + if (default_browser_setting) { |
| + shell_integration::SetAsDefaultBrowser(); |
| + } |
| +} |
| #endif // defined(OS_MACOSX) |
| void ChromeMainDelegate::PreSandboxStartup() { |
| @@ -715,6 +731,7 @@ void ChromeMainDelegate::PreSandboxStartup() { |
| Append(chrome::kHelperProcessExecutablePath)); |
| InitMacCrashReporter(command_line, process_type); |
| + SetUpInstallerPreferences(command_line); |
| #endif |
| #if defined(OS_WIN) |