summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/browser_main.cc8
-rw-r--r--chrome/browser/first_run.cc2
-rw-r--r--chrome/browser/first_run_gtk.cc7
-rw-r--r--chrome/browser/views/first_run_customize_view.cc1
-rw-r--r--chrome/browser/views/first_run_view.cc3
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;
}