| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/gtk/first_run_dialog.h" | 5 #include "chrome/browser/ui/gtk/first_run_dialog.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| 11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "chrome/app/breakpad_linux.h" | |
| 14 #include "chrome/browser/first_run/first_run_dialog.h" | 13 #include "chrome/browser/first_run/first_run_dialog.h" |
| 15 #include "chrome/browser/platform_util.h" | 14 #include "chrome/browser/platform_util.h" |
| 16 #include "chrome/browser/process_singleton.h" | 15 #include "chrome/browser/process_singleton.h" |
| 17 #include "chrome/browser/shell_integration.h" | 16 #include "chrome/browser/shell_integration.h" |
| 18 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" | 17 #include "chrome/browser/ui/gtk/gtk_chrome_link_button.h" |
| 19 #include "chrome/browser/ui/gtk/gtk_util.h" | 18 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 20 #include "chrome/common/pref_names.h" | 19 #include "chrome/common/pref_names.h" |
| 21 #include "chrome/common/url_constants.h" | 20 #include "chrome/common/url_constants.h" |
| 22 #include "chrome/installer/util/google_update_settings.h" | 21 #include "chrome/installer/util/google_update_settings.h" |
| 22 #include "components/breakpad/app/breakpad_linux.h" |
| 23 #include "grit/chromium_strings.h" | 23 #include "grit/chromium_strings.h" |
| 24 #include "grit/generated_resources.h" | 24 #include "grit/generated_resources.h" |
| 25 #include "grit/locale_settings.h" | 25 #include "grit/locale_settings.h" |
| 26 #include "grit/theme_resources.h" | 26 #include "grit/theme_resources.h" |
| 27 #include "ui/base/gtk/gtk_floating_container.h" | 27 #include "ui/base/gtk/gtk_floating_container.h" |
| 28 #include "ui/base/gtk/gtk_hig_constants.h" | 28 #include "ui/base/gtk/gtk_hig_constants.h" |
| 29 #include "ui/base/l10n/l10n_util.h" | 29 #include "ui/base/l10n/l10n_util.h" |
| 30 #include "ui/base/resource/resource_bundle.h" | 30 #include "ui/base/resource/resource_bundle.h" |
| 31 | 31 |
| 32 #if defined(GOOGLE_CHROME_BUILD) | 32 #if defined(GOOGLE_CHROME_BUILD) |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 } | 157 } |
| 158 | 158 |
| 159 void FirstRunDialog::OnResponseDialog(GtkWidget* widget, int response) { | 159 void FirstRunDialog::OnResponseDialog(GtkWidget* widget, int response) { |
| 160 if (dialog_) | 160 if (dialog_) |
| 161 gtk_widget_hide_all(dialog_); | 161 gtk_widget_hide_all(dialog_); |
| 162 | 162 |
| 163 // Check if user has opted into reporting. | 163 // Check if user has opted into reporting. |
| 164 if (report_crashes_ && | 164 if (report_crashes_ && |
| 165 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(report_crashes_))) { | 165 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(report_crashes_))) { |
| 166 if (GoogleUpdateSettings::SetCollectStatsConsent(true)) | 166 if (GoogleUpdateSettings::SetCollectStatsConsent(true)) |
| 167 InitCrashReporter(); | 167 breakpad::InitCrashReporter(); |
| 168 } else { | 168 } else { |
| 169 GoogleUpdateSettings::SetCollectStatsConsent(false); | 169 GoogleUpdateSettings::SetCollectStatsConsent(false); |
| 170 } | 170 } |
| 171 | 171 |
| 172 // If selected set as default browser. | 172 // If selected set as default browser. |
| 173 if (make_default_ && | 173 if (make_default_ && |
| 174 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(make_default_))) { | 174 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(make_default_))) { |
| 175 ShellIntegration::SetAsDefaultBrowser(); | 175 ShellIntegration::SetAsDefaultBrowser(); |
| 176 } | 176 } |
| 177 | 177 |
| 178 FirstRunDone(); | 178 FirstRunDone(); |
| 179 } | 179 } |
| 180 | 180 |
| 181 void FirstRunDialog::OnLearnMoreLinkClicked(GtkButton* button) { | 181 void FirstRunDialog::OnLearnMoreLinkClicked(GtkButton* button) { |
| 182 platform_util::OpenExternal(GURL(chrome::kLearnMoreReportingURL)); | 182 platform_util::OpenExternal(GURL(chrome::kLearnMoreReportingURL)); |
| 183 } | 183 } |
| 184 | 184 |
| 185 void FirstRunDialog::FirstRunDone() { | 185 void FirstRunDialog::FirstRunDone() { |
| 186 first_run::SetShouldShowWelcomePage(); | 186 first_run::SetShouldShowWelcomePage(); |
| 187 | 187 |
| 188 if (dialog_) | 188 if (dialog_) |
| 189 gtk_widget_destroy(dialog_); | 189 gtk_widget_destroy(dialog_); |
| 190 base::MessageLoop::current()->Quit(); | 190 base::MessageLoop::current()->Quit(); |
| 191 delete this; | 191 delete this; |
| 192 } | 192 } |
| OLD | NEW |