OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 } | 99 } |
100 | 100 |
101 } // namespace first_run | 101 } // namespace first_run |
102 | 102 |
103 // static | 103 // static |
104 bool FirstRunDialog::Show(Profile* profile, | 104 bool FirstRunDialog::Show(Profile* profile, |
105 bool randomize_search_engine_order) { | 105 bool randomize_search_engine_order) { |
106 // Figure out which dialogs we will show. | 106 // Figure out which dialogs we will show. |
107 // If the default search is managed via policy, we won't ask. | 107 // If the default search is managed via policy, we won't ask. |
108 const TemplateURLModel* search_engines_model = profile->GetTemplateURLModel(); | 108 const TemplateURLModel* search_engines_model = profile->GetTemplateURLModel(); |
109 bool show_search_engines_dialog = search_engines_model && | 109 bool show_search_engines_dialog = |
| 110 !FirstRun::SearchEngineSelectorDisallowed() && |
| 111 search_engines_model && |
110 !search_engines_model->is_default_search_managed(); | 112 !search_engines_model->is_default_search_managed(); |
111 | 113 |
112 #if defined(GOOGLE_CHROME_BUILD) | 114 #if defined(GOOGLE_CHROME_BUILD) |
113 // If the metrics reporting is managed, we won't ask. | 115 // If the metrics reporting is managed, we won't ask. |
114 const PrefService::Preference* metrics_reporting_pref = | 116 const PrefService::Preference* metrics_reporting_pref = |
115 g_browser_process->local_state()->FindPreference( | 117 g_browser_process->local_state()->FindPreference( |
116 prefs::kMetricsReportingEnabled); | 118 prefs::kMetricsReportingEnabled); |
117 bool show_reporting_dialog = !metrics_reporting_pref || | 119 bool show_reporting_dialog = !metrics_reporting_pref || |
118 !metrics_reporting_pref->IsManaged(); | 120 !metrics_reporting_pref->IsManaged(); |
119 #else | 121 #else |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 } | 428 } |
427 | 429 |
428 void FirstRunDialog::FirstRunDone() { | 430 void FirstRunDialog::FirstRunDone() { |
429 FirstRun::SetShowWelcomePagePref(); | 431 FirstRun::SetShowWelcomePagePref(); |
430 | 432 |
431 if (dialog_) | 433 if (dialog_) |
432 gtk_widget_destroy(dialog_); | 434 gtk_widget_destroy(dialog_); |
433 MessageLoop::current()->Quit(); | 435 MessageLoop::current()->Quit(); |
434 delete this; | 436 delete this; |
435 } | 437 } |
OLD | NEW |