diff options
author | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-17 16:51:10 +0000 |
---|---|---|
committer | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-17 16:51:10 +0000 |
commit | 8c14a436fe6488c8f647ff79301102e885838c77 (patch) | |
tree | 892832adcf466be0b9515ab2b84553a94afb5814 | |
parent | effb25df8e23ffc027fefe0b271a47e16f7a6240 (diff) | |
download | chromium_src-8c14a436fe6488c8f647ff79301102e885838c77.zip chromium_src-8c14a436fe6488c8f647ff79301102e885838c77.tar.gz chromium_src-8c14a436fe6488c8f647ff79301102e885838c77.tar.bz2 |
Exit Chrome and show FRUI again on the next run, if user clicks on Cancel.
BUG=10825
Review URL: http://codereview.chromium.org/118528
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18624 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/browser_main.cc | 8 | ||||
-rw-r--r-- | chrome/browser/first_run.cc | 2 | ||||
-rw-r--r-- | chrome/browser/first_run_gtk.cc | 7 | ||||
-rw-r--r-- | chrome/browser/views/first_run_customize_view.cc | 1 | ||||
-rw-r--r-- | chrome/browser/views/first_run_view.cc | 3 |
5 files changed, 15 insertions, 6 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index af71c74..a8cf018 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -392,6 +392,10 @@ int BrowserMain(const MainFunctionParams& parameters) { // method at present. Profile* profile = NULL; OpenFirstRunDialog(profile, &process_singleton); + // If user cancelled the first run dialog box, the first run sentinel file + // didn't get created and we should exit Chrome. + if (FirstRun::IsChromeFirstRun()) + return ResultCodes::NORMAL_EXIT; } #endif // OS_POSIX @@ -610,6 +614,10 @@ int BrowserMain(const MainFunctionParams& parameters) { // touches reads preferences. if (is_first_run && !first_run_ui_bypass) { OpenFirstRunDialog(profile, &process_singleton); + // If user cancelled the first run dialog box, the first run sentinel file + // didn't get created and we should exit Chrome. + if (FirstRun::IsChromeFirstRun()) + return ResultCodes::NORMAL_EXIT; } #endif // OS_POSIX diff --git a/chrome/browser/first_run.cc b/chrome/browser/first_run.cc index f0b0f74..7f8538f 100644 --- a/chrome/browser/first_run.cc +++ b/chrome/browser/first_run.cc @@ -59,7 +59,7 @@ bool GetFirstRunSentinelFilePath(FilePath* path) { #if !defined(OS_MACOSX) bool FirstRun::IsChromeFirstRun() { // A troolean, 0 means not yet set, 1 means set to true, 2 set to false. - static int first_run = 0; + int first_run = 0; if (first_run != 0) return first_run == 1; diff --git a/chrome/browser/first_run_gtk.cc b/chrome/browser/first_run_gtk.cc index 8d9fe18..b324fec 100644 --- a/chrome/browser/first_run_gtk.cc +++ b/chrome/browser/first_run_gtk.cc @@ -112,6 +112,8 @@ void OpenFirstRunDialog(Profile* profile, ProcessSingleton* process_singleton) { // End of above TODO. if (response == GTK_RESPONSE_ACCEPT) { + // Mark that first run has ran. + FirstRun::CreateSentinel(); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check))) { // They opted in. if (GoogleUpdateSettings::SetCollectStatsConsent(true)) { @@ -123,8 +125,7 @@ void OpenFirstRunDialog(Profile* profile, ProcessSingleton* process_singleton) { } gtk_widget_destroy(dialog); -#endif // defined(GOOGLE_CHROME_BUILD) - - // Mark that first run has ran. +#else // defined(GOOGLE_CHROME_BUILD) FirstRun::CreateSentinel(); +#endif } diff --git a/chrome/browser/views/first_run_customize_view.cc b/chrome/browser/views/first_run_customize_view.cc index 4639344..9409f69 100644 --- a/chrome/browser/views/first_run_customize_view.cc +++ b/chrome/browser/views/first_run_customize_view.cc @@ -211,6 +211,7 @@ bool FirstRunCustomizeView::Accept() { // Exit the message loop we were started with so that startup can continue. MessageLoop::current()->Quit(); + FirstRunComplete(); return true; } diff --git a/chrome/browser/views/first_run_view.cc b/chrome/browser/views/first_run_view.cc index bd172f1..23e2b59 100644 --- a/chrome/browser/views/first_run_view.cc +++ b/chrome/browser/views/first_run_view.cc @@ -45,8 +45,6 @@ FirstRunView::FirstRunView(Profile* profile) } FirstRunView::~FirstRunView() { - FirstRunComplete(); - // Exit the message loop we were started with so that startup can continue. MessageLoop::current()->Quit(); } @@ -186,6 +184,7 @@ bool FirstRunView::Accept() { if (default_browser_->checked()) SetDefaultBrowser(); + FirstRunComplete(); return true; } |