diff options
author | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-26 08:24:27 +0000 |
---|---|---|
committer | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-26 08:24:27 +0000 |
commit | 9ca5aaeaf2f5acb0b947a0e0fcad20416651c9bc (patch) | |
tree | d9687c876fe14ba879312951c09f4038a138ba12 /chrome/browser/first_run | |
parent | 8d0655414fc82216020dd74a80f65842bc39595d (diff) | |
download | chromium_src-9ca5aaeaf2f5acb0b947a0e0fcad20416651c9bc.zip chromium_src-9ca5aaeaf2f5acb0b947a0e0fcad20416651c9bc.tar.gz chromium_src-9ca5aaeaf2f5acb0b947a0e0fcad20416651c9bc.tar.bz2 |
[mac] Hide stats opt-in in first run if controlled by policy
The first run checkbox that asks the user for their agreement to send stats and
crash reports to Google should be hidden if that decision has been made by the
administrator through configuration management. Also remove a DCHECK that
tested for the crash reporter not being initialized during first run, since it
may be present in case configuration management is in effect.
BUG=49917
TEST=Configure MetricsReportingEnabled policy and trigger a first run, check UI.
Review URL: http://codereview.chromium.org/3152050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57494 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/first_run')
-rw-r--r-- | chrome/browser/first_run/first_run_mac.mm | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/chrome/browser/first_run/first_run_mac.mm b/chrome/browser/first_run/first_run_mac.mm index e982903..0795bce 100644 --- a/chrome/browser/first_run/first_run_mac.mm +++ b/chrome/browser/first_run/first_run_mac.mm @@ -72,14 +72,6 @@ bool FirstRunController::DoFirstRun(Profile* profile, // This object is responsible for deleting itself, make sure that happens. scoped_ptr<FirstRunController> gc(this); - // Breakpad should not be enabled on first run until the user has explicitly - // opted-into stats. - // TODO: The behavior we probably want here is to enable Breakpad on first run - // but display a confirmation dialog before sending a crash report so we - // respect a user's privacy while still getting any crashes that might happen - // before this point. Then remove the need for that dialog here. - DCHECK(!IsCrashReporterEnabled()); - scoped_nsobject<FirstRunDialogController> dialog( [[FirstRunDialogController alloc] init]); @@ -108,23 +100,24 @@ bool FirstRunController::DoFirstRun(Profile* profile, return false; } - // Don't enable stats in Chromium. - bool stats_enabled = false; -#if defined(GOOGLE_CHROME_BUILD) - stats_enabled = [dialog.get() statsEnabled] ? true : false; -#endif // GOOGLE_CHROME_BUILD FirstRun::CreateSentinel(); - GoogleUpdateSettings::SetCollectStatsConsent(stats_enabled); + + // If the dialog asked the user to opt-in for stats and crash reporting, + // record the decision and enable the crash reporter if appropriate. + if (![dialog.get() statsCheckboxHidden]) { + bool stats_enabled = [dialog.get() statsEnabled]; + GoogleUpdateSettings::SetCollectStatsConsent(stats_enabled); #if defined(GOOGLE_CHROME_BUILD) - // Breakpad is normally enabled very early in the startup process, - // however, on the first run it's off by default. If the user opts-in to - // stats, enable breakpad. - if (stats_enabled) { - InitCrashReporter(); - InitCrashProcessInfo(); - } + // Breakpad is normally enabled very early in the startup process. However, + // on the first run it may not have been enabled due to the missing opt-in + // from the user. If the user agreed now, enable breakpad if necessary. + if (!IsCrashReporterEnabled() && stats_enabled) { + InitCrashReporter(); + InitCrashProcessInfo(); + } #endif // GOOGLE_CHROME_BUILD + } // If selected set as default browser. BOOL make_default_browser = [dialog.get() makeDefaultBrowser]; |