diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-21 21:49:05 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-21 21:49:05 +0000 |
commit | 1d8e4ce0743eed37a143d99e568c28abbe3202f1 (patch) | |
tree | ce8c850b2fa6d8a87f419255c368817c02f23a4f /chrome/browser/browser_main.cc | |
parent | f59a9c06d5cc9b7e0faace2b76582d3a12c3ec6c (diff) | |
download | chromium_src-1d8e4ce0743eed37a143d99e568c28abbe3202f1.zip chromium_src-1d8e4ce0743eed37a143d99e568c28abbe3202f1.tar.gz chromium_src-1d8e4ce0743eed37a143d99e568c28abbe3202f1.tar.bz2 |
Implement temporary First Run Dialog on OS X
We use a modal dialog with a single checkbox on OS X.
We use the OSX defaults system since we want something quick and reliable. The
dialog is displayed at a very early stage in Chrome startup (Before any
subsystems start relying on the stats variable). This means there are a few
quirks in displaying the UI.
A change was also needed to our event handling code since when the dialog is
shown we spin an event loop at a very early stage in the process lifetime.
Changed default value for stats to false and updated unit tests to reflect that.
Also some misc. minor cleanup.
BUG=11971,12046
Review URL: http://codereview.chromium.org/115608
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16669 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_main.cc')
-rw-r--r-- | chrome/browser/browser_main.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 0f023c3..78ae72d 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -327,6 +327,18 @@ int BrowserMain(const MainFunctionParams& parameters) { local_state->RegisterStringPref(prefs::kApplicationLocale, L""); local_state->RegisterBooleanPref(prefs::kMetricsReportingEnabled, false); +#if defined(OS_POSIX) + // On POSIX we display the first run dialog as early as possible, so we can + // get the stats enabled. + if (is_first_run && !first_run_ui_bypass) { + // Dummy value, we don't need the profile for the OS X version of this + // method at present. + Profile* profile = NULL; + OpenFirstRunDialog(profile, &process_singleton); + } +#endif // OS_POSIX + + // During first run we read the google_update registry key to find what // language the user selected when downloading the installer. This // becomes our default language in the prefs. @@ -511,6 +523,12 @@ int BrowserMain(const MainFunctionParams& parameters) { process_singleton.Create(); + // TODO: This block of code should probably be used on all platforms! + // On POSIX we need to display this dialog before setting the value of + // kMetricsReportingEnabled, so we display this dialog much earlier. + // On Windows a download is tagged with stats enabled/disabled so the UI + // can be displayed later in the startup process. +#if defined(OS_WIN) // Show the First Run UI if this is the first time Chrome has been run on // this computer, or we're being compelled to do so by a command line flag. // Note that this be done _after_ the PrefService is initialized and all @@ -519,6 +537,7 @@ int BrowserMain(const MainFunctionParams& parameters) { if (is_first_run && !first_run_ui_bypass) { OpenFirstRunDialog(profile, &process_singleton); } +#endif // OS_WIN // Sets things up so that if we crash from this point on, a dialog will // popup asking the user to restart chrome. It is done this late to avoid |