| 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" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 } // namespace first_run | 104 } // namespace first_run |
| 105 | 105 |
| 106 // static | 106 // static |
| 107 bool FirstRunDialog::Show(Profile* profile, | 107 bool FirstRunDialog::Show(Profile* profile, |
| 108 bool randomize_search_engine_order) { | 108 bool randomize_search_engine_order) { |
| 109 // Figure out which dialogs we will show. | 109 // Figure out which dialogs we will show. |
| 110 // If the default search is managed via policy, we won't ask. | 110 // If the default search is managed via policy, we won't ask. |
| 111 const TemplateURLService* search_engines_model = | 111 const TemplateURLService* search_engines_model = |
| 112 TemplateURLServiceFactory::GetForProfile(profile); | 112 TemplateURLServiceFactory::GetForProfile(profile); |
| 113 bool show_search_engines_dialog = | 113 bool show_search_engines_dialog = |
| 114 FirstRun::ShouldShowSearchEngineSelector(search_engines_model); | 114 first_run::ShouldShowSearchEngineSelector(search_engines_model); |
| 115 | 115 |
| 116 #if defined(GOOGLE_CHROME_BUILD) | 116 #if defined(GOOGLE_CHROME_BUILD) |
| 117 // If the metrics reporting is managed, we won't ask. | 117 // If the metrics reporting is managed, we won't ask. |
| 118 const PrefService::Preference* metrics_reporting_pref = | 118 const PrefService::Preference* metrics_reporting_pref = |
| 119 g_browser_process->local_state()->FindPreference( | 119 g_browser_process->local_state()->FindPreference( |
| 120 prefs::kMetricsReportingEnabled); | 120 prefs::kMetricsReportingEnabled); |
| 121 bool show_reporting_dialog = !metrics_reporting_pref || | 121 bool show_reporting_dialog = !metrics_reporting_pref || |
| 122 !metrics_reporting_pref->IsManaged(); | 122 !metrics_reporting_pref->IsManaged(); |
| 123 #else | 123 #else |
| 124 bool show_reporting_dialog = false; | 124 bool show_reporting_dialog = false; |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 } | 432 } |
| 433 | 433 |
| 434 void FirstRunDialog::FirstRunDone() { | 434 void FirstRunDialog::FirstRunDone() { |
| 435 first_run::SetShowWelcomePagePref(); | 435 first_run::SetShowWelcomePagePref(); |
| 436 | 436 |
| 437 if (dialog_) | 437 if (dialog_) |
| 438 gtk_widget_destroy(dialog_); | 438 gtk_widget_destroy(dialog_); |
| 439 MessageLoop::current()->Quit(); | 439 MessageLoop::current()->Quit(); |
| 440 delete this; | 440 delete this; |
| 441 } | 441 } |
| OLD | NEW |