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

Unified Diff: chrome/app/chrome_main_delegate.cc

Issue 2270083002: Added in switches for the Mac Installer to send preferences to Chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cl5_review
Patch Set: Rebased Created 4 years, 4 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_main_delegate.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..aed0427230ba5a2cc4661c62f0c0597b37188047 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,18 @@ 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::kMakeChromeDefault);
+
+ if (uma_setting)
+ crash_reporter::SetUploadConsent(uma_setting);
+ if (default_browser_setting)
+ shell_integration::SetAsDefaultBrowser();
+}
#endif // defined(OS_MACOSX)
void ChromeMainDelegate::PreSandboxStartup() {
@@ -715,6 +728,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
Append(chrome::kHelperProcessExecutablePath));
InitMacCrashReporter(command_line, process_type);
+ SetUpInstallerPreferences(command_line);
#endif
#if defined(OS_WIN)
« no previous file with comments | « chrome/app/chrome_main_delegate.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698