OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/dom_ui/options_ui.h" | 5 #include "chrome/browser/dom_ui/options_ui.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/callback.h" | 9 #include "base/callback.h" |
10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/singleton.h" | 12 #include "base/singleton.h" |
13 #include "base/string_piece.h" | 13 #include "base/string_piece.h" |
14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
15 #include "base/thread.h" | 15 #include "base/thread.h" |
16 #include "base/time.h" | 16 #include "base/time.h" |
17 #include "base/values.h" | 17 #include "base/values.h" |
18 #include "chrome/browser/chrome_thread.h" | 18 #include "chrome/browser/chrome_thread.h" |
19 #include "chrome/browser/dom_ui/add_startup_page_handler.h" | 19 #include "chrome/browser/dom_ui/add_startup_page_handler.h" |
20 #include "chrome/browser/dom_ui/advanced_options_handler.h" | 20 #include "chrome/browser/dom_ui/advanced_options_handler.h" |
21 #include "chrome/browser/dom_ui/browser_options_handler.h" | 21 #include "chrome/browser/dom_ui/browser_options_handler.h" |
22 #include "chrome/browser/dom_ui/clear_browser_data_handler.h" | 22 #include "chrome/browser/dom_ui/clear_browser_data_handler.h" |
23 #include "chrome/browser/dom_ui/content_settings_handler.h" | 23 #include "chrome/browser/dom_ui/content_settings_handler.h" |
24 #include "chrome/browser/dom_ui/core_options_handler.h" | 24 #include "chrome/browser/dom_ui/core_options_handler.h" |
25 #include "chrome/browser/dom_ui/font_settings_handler.h" | 25 #include "chrome/browser/dom_ui/font_settings_handler.h" |
26 #include "chrome/browser/dom_ui/personal_options_handler.h" | 26 #include "chrome/browser/dom_ui/personal_options_handler.h" |
| 27 #include "chrome/browser/dom_ui/search_engine_manager_handler.h" |
27 #include "chrome/browser/dom_ui/sync_options_handler.h" | 28 #include "chrome/browser/dom_ui/sync_options_handler.h" |
28 #include "chrome/browser/metrics/user_metrics.h" | 29 #include "chrome/browser/metrics/user_metrics.h" |
29 #include "chrome/browser/pref_service.h" | 30 #include "chrome/browser/pref_service.h" |
30 #include "chrome/browser/profile.h" | 31 #include "chrome/browser/profile.h" |
31 #include "chrome/browser/tab_contents/tab_contents.h" | 32 #include "chrome/browser/tab_contents/tab_contents.h" |
32 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 33 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
33 #include "chrome/common/jstemplate_builder.h" | 34 #include "chrome/common/jstemplate_builder.h" |
34 #include "chrome/common/notification_service.h" | 35 #include "chrome/common/notification_service.h" |
35 #include "chrome/common/notification_type.h" | 36 #include "chrome/common/notification_type.h" |
36 #include "chrome/common/time_format.h" | 37 #include "chrome/common/time_format.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 AddOptionsPageUIHandler(localized_strings, new CoreOptionsHandler()); | 120 AddOptionsPageUIHandler(localized_strings, new CoreOptionsHandler()); |
120 #endif | 121 #endif |
121 | 122 |
122 AddOptionsPageUIHandler(localized_strings, new AddStartupPageHandler()); | 123 AddOptionsPageUIHandler(localized_strings, new AddStartupPageHandler()); |
123 AddOptionsPageUIHandler(localized_strings, new AdvancedOptionsHandler()); | 124 AddOptionsPageUIHandler(localized_strings, new AdvancedOptionsHandler()); |
124 AddOptionsPageUIHandler(localized_strings, new BrowserOptionsHandler()); | 125 AddOptionsPageUIHandler(localized_strings, new BrowserOptionsHandler()); |
125 AddOptionsPageUIHandler(localized_strings, new ClearBrowserDataHandler()); | 126 AddOptionsPageUIHandler(localized_strings, new ClearBrowserDataHandler()); |
126 AddOptionsPageUIHandler(localized_strings, new ContentSettingsHandler()); | 127 AddOptionsPageUIHandler(localized_strings, new ContentSettingsHandler()); |
127 AddOptionsPageUIHandler(localized_strings, new FontSettingsHandler()); | 128 AddOptionsPageUIHandler(localized_strings, new FontSettingsHandler()); |
128 AddOptionsPageUIHandler(localized_strings, new PersonalOptionsHandler()); | 129 AddOptionsPageUIHandler(localized_strings, new PersonalOptionsHandler()); |
| 130 AddOptionsPageUIHandler(localized_strings, new SearchEngineManagerHandler()); |
129 AddOptionsPageUIHandler(localized_strings, new SyncOptionsHandler()); | 131 AddOptionsPageUIHandler(localized_strings, new SyncOptionsHandler()); |
130 #if defined(OS_CHROMEOS) | 132 #if defined(OS_CHROMEOS) |
131 AddOptionsPageUIHandler(localized_strings, | 133 AddOptionsPageUIHandler(localized_strings, |
132 new chromeos::AccountsOptionsHandler()); | 134 new chromeos::AccountsOptionsHandler()); |
133 AddOptionsPageUIHandler(localized_strings, new LabsHandler()); | 135 AddOptionsPageUIHandler(localized_strings, new LabsHandler()); |
134 AddOptionsPageUIHandler(localized_strings, | 136 AddOptionsPageUIHandler(localized_strings, |
135 new LanguageChewingOptionsHandler()); | 137 new LanguageChewingOptionsHandler()); |
136 AddOptionsPageUIHandler(localized_strings, | 138 AddOptionsPageUIHandler(localized_strings, |
137 new LanguageHangulOptionsHandler()); | 139 new LanguageHangulOptionsHandler()); |
138 AddOptionsPageUIHandler(localized_strings, new LanguageOptionsHandler()); | 140 AddOptionsPageUIHandler(localized_strings, new LanguageOptionsHandler()); |
(...skipping 29 matching lines...) Expand all Loading... |
168 (static_cast<OptionsPageUIHandler*>(*iter))->Initialize(); | 170 (static_cast<OptionsPageUIHandler*>(*iter))->Initialize(); |
169 } | 171 } |
170 } | 172 } |
171 | 173 |
172 void OptionsUI::AddOptionsPageUIHandler(DictionaryValue* localized_strings, | 174 void OptionsUI::AddOptionsPageUIHandler(DictionaryValue* localized_strings, |
173 OptionsPageUIHandler* handler) { | 175 OptionsPageUIHandler* handler) { |
174 DCHECK(handler); | 176 DCHECK(handler); |
175 handler->GetLocalizedValues(localized_strings); | 177 handler->GetLocalizedValues(localized_strings); |
176 AddMessageHandler(handler->Attach(this)); | 178 AddMessageHandler(handler->Attach(this)); |
177 } | 179 } |
OLD | NEW |