OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/first_run.h" | 5 #include "chrome/browser/first_run.h" |
6 | 6 |
| 7 #include "chrome/app/breakpad_linux.h" |
7 // We need to reach through the browser process to tweak the metrics flag. | 8 // We need to reach through the browser process to tweak the metrics flag. |
8 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
9 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
10 #include "chrome/common/pref_service.h" | 11 #include "chrome/common/pref_service.h" |
| 12 #include "chrome/installer/util/google_update_settings.h" |
11 | 13 |
12 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
13 | 15 |
14 namespace { | 16 namespace { |
15 | 17 |
16 // Callback for the "response" signal of the first run dialog. | 18 // Callback for the "response" signal of the first run dialog. |
17 // Fills in the int* |data| with the dialog response and quits the message loop. | 19 // Fills in the int* |data| with the dialog response and quits the message loop. |
18 // See the TODO below for why this is necessary (it's a bug). | 20 // See the TODO below for why this is necessary (it's a bug). |
19 void DialogResponseCallback(GtkDialog* dialog, gint response, | 21 void DialogResponseCallback(GtkDialog* dialog, gint response, |
20 gpointer data) { | 22 gpointer data) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // but that spins a nested message loop and hoses us. :( | 89 // but that spins a nested message loop and hoses us. :( |
88 // http://code.google.com/p/chromium/issues/detail?id=12552 | 90 // http://code.google.com/p/chromium/issues/detail?id=12552 |
89 // Instead, run a loop and extract the response manually. | 91 // Instead, run a loop and extract the response manually. |
90 int response = 0; | 92 int response = 0; |
91 g_signal_connect(G_OBJECT(dialog), "response", | 93 g_signal_connect(G_OBJECT(dialog), "response", |
92 G_CALLBACK(DialogResponseCallback), &response); | 94 G_CALLBACK(DialogResponseCallback), &response); |
93 gtk_widget_show(dialog); | 95 gtk_widget_show(dialog); |
94 MessageLoop::current()->Run(); | 96 MessageLoop::current()->Run(); |
95 // End of above TODO. | 97 // End of above TODO. |
96 | 98 |
97 if (response == GTK_RESPONSE_ACCEPT && | 99 if (response == GTK_RESPONSE_ACCEPT) { |
98 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check))) { | 100 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check))) { |
99 // They opted in. | 101 // They opted in. |
100 g_browser_process->local_state()->SetBoolean( | 102 if (GoogleUpdateSettings::SetCollectStatsConsent(true)) { |
101 prefs::kMetricsReportingEnabled, true); | 103 InitCrashReporter(); |
| 104 } |
| 105 } else { |
| 106 GoogleUpdateSettings::SetCollectStatsConsent(false); |
| 107 } |
102 } | 108 } |
103 | 109 |
104 gtk_widget_destroy(dialog); | 110 gtk_widget_destroy(dialog); |
105 #endif // defined(GOOGLE_CHROME_BUILD) | 111 #endif // defined(GOOGLE_CHROME_BUILD) |
106 | 112 |
107 // Mark that first run has ran. | 113 // Mark that first run has ran. |
108 FirstRun::CreateSentinel(); | 114 FirstRun::CreateSentinel(); |
109 } | 115 } |
OLD | NEW |