Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(520)

Side by Side Diff: chrome/browser/gtk/first_run_dialog.cc

Issue 209042: Make Linux Breakpad initialization call to lsb_release asynchronous. Also wrap more... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/gtk/first_run_dialog.h" 5 #include "chrome/browser/gtk/first_run_dialog.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "chrome/app/breakpad_linux.h"
11 #include "chrome/browser/gtk/gtk_chrome_link_button.h" 10 #include "chrome/browser/gtk/gtk_chrome_link_button.h"
12 #include "chrome/browser/shell_integration.h" 11 #include "chrome/browser/shell_integration.h"
13 #include "chrome/common/gtk_util.h" 12 #include "chrome/common/gtk_util.h"
14 #include "chrome/common/platform_util.h" 13 #include "chrome/common/platform_util.h"
15 #include "chrome/installer/util/google_update_settings.h" 14 #include "chrome/installer/util/google_update_settings.h"
16 #include "grit/generated_resources.h" 15 #include "grit/generated_resources.h"
17 #include "grit/google_chrome_strings.h" 16 #include "grit/google_chrome_strings.h"
18 #include "grit/locale_settings.h" 17 #include "grit/locale_settings.h"
19 18
19 #if defined(USE_LINUX_BREAKPAD)
20 #include "chrome/app/breakpad_linux.h"
21 #endif
22
20 // static 23 // static
21 bool FirstRunDialog::Show(Profile* profile) { 24 bool FirstRunDialog::Show(Profile* profile) {
22 int response = -1; 25 int response = -1;
23 new FirstRunDialog(profile, response); 26 new FirstRunDialog(profile, response);
24 return (response == GTK_RESPONSE_ACCEPT); 27 return (response == GTK_RESPONSE_ACCEPT);
25 } 28 }
26 29
27 FirstRunDialog::FirstRunDialog(Profile* profile, int& response) 30 FirstRunDialog::FirstRunDialog(Profile* profile, int& response)
28 : dialog_(NULL), report_crashes_(NULL), make_default_(NULL), 31 : dialog_(NULL), report_crashes_(NULL), make_default_(NULL),
29 import_data_(NULL), import_profile_(NULL), profile_(profile), 32 import_data_(NULL), import_profile_(NULL), profile_(profile),
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 gtk_widget_hide_all(dialog_); 130 gtk_widget_hide_all(dialog_);
128 response_ = response; 131 response_ = response;
129 132
130 if (response == GTK_RESPONSE_ACCEPT) { 133 if (response == GTK_RESPONSE_ACCEPT) {
131 // Mark that first run has ran. 134 // Mark that first run has ran.
132 FirstRun::CreateSentinel(); 135 FirstRun::CreateSentinel();
133 136
134 // Check if user has opted into reporting. 137 // Check if user has opted into reporting.
135 if (report_crashes_ && 138 if (report_crashes_ &&
136 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(report_crashes_))) { 139 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(report_crashes_))) {
140 #if defined(USE_LINUX_BREAKPAD)
137 if (GoogleUpdateSettings::SetCollectStatsConsent(true)) { 141 if (GoogleUpdateSettings::SetCollectStatsConsent(true)) {
138 InitCrashReporter(); 142 InitCrashReporter();
139 } 143 }
144 #endif
140 } else { 145 } else {
141 GoogleUpdateSettings::SetCollectStatsConsent(false); 146 GoogleUpdateSettings::SetCollectStatsConsent(false);
142 } 147 }
143 148
144 // If selected set as default browser. 149 // If selected set as default browser.
145 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(make_default_))) 150 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(make_default_)))
146 ShellIntegration::SetAsDefaultBrowser(); 151 ShellIntegration::SetAsDefaultBrowser();
147 152
148 // Import data if selected. 153 // Import data if selected.
149 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(import_data_))) { 154 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(import_data_))) {
(...skipping 21 matching lines...) Expand all
171 176
172 void FirstRunDialog::FirstRunDone() { 177 void FirstRunDialog::FirstRunDone() {
173 // Set preference to show first run bubble and welcome page. 178 // Set preference to show first run bubble and welcome page.
174 FirstRun::SetShowFirstRunBubblePref(); 179 FirstRun::SetShowFirstRunBubblePref();
175 FirstRun::SetShowWelcomePagePref(); 180 FirstRun::SetShowWelcomePagePref();
176 181
177 gtk_widget_destroy(dialog_); 182 gtk_widget_destroy(dialog_);
178 MessageLoop::current()->Quit(); 183 MessageLoop::current()->Quit();
179 delete this; 184 delete this;
180 } 185 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698