| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/i18n/time_formatting.h" | 11 #include "base/i18n/time_formatting.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/singleton.h" | 13 #include "base/singleton.h" |
| 14 #include "base/string_piece.h" | 14 #include "base/string_piece.h" |
| 15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
| 16 #include "base/thread.h" | 16 #include "base/thread.h" |
| 17 #include "base/time.h" | 17 #include "base/time.h" |
| 18 #include "base/values.h" | 18 #include "base/values.h" |
| 19 #include "chrome/browser/chrome_thread.h" | 19 #include "chrome/browser/chrome_thread.h" |
| 20 #include "chrome/browser/dom_ui/add_startup_page_handler.h" | 20 #include "chrome/browser/dom_ui/add_startup_page_handler.h" |
| 21 #include "chrome/browser/dom_ui/advanced_options_handler.h" | 21 #include "chrome/browser/dom_ui/advanced_options_handler.h" |
| 22 #include "chrome/browser/dom_ui/browser_options_handler.h" | 22 #include "chrome/browser/dom_ui/browser_options_handler.h" |
| 23 #include "chrome/browser/dom_ui/clear_browser_data_handler.h" | 23 #include "chrome/browser/dom_ui/clear_browser_data_handler.h" |
| 24 #include "chrome/browser/dom_ui/content_settings_handler.h" | 24 #include "chrome/browser/dom_ui/content_settings_handler.h" |
| 25 #include "chrome/browser/dom_ui/core_options_handler.h" | 25 #include "chrome/browser/dom_ui/core_options_handler.h" |
| 26 #include "chrome/browser/dom_ui/font_settings_handler.h" | 26 #include "chrome/browser/dom_ui/font_settings_handler.h" |
| 27 #include "chrome/browser/dom_ui/import_data_handler.h" | 27 #include "chrome/browser/dom_ui/import_data_handler.h" |
| 28 #include "chrome/browser/dom_ui/passwords_exceptions_handler.h" |
| 28 #include "chrome/browser/dom_ui/personal_options_handler.h" | 29 #include "chrome/browser/dom_ui/personal_options_handler.h" |
| 29 #include "chrome/browser/dom_ui/search_engine_manager_handler.h" | 30 #include "chrome/browser/dom_ui/search_engine_manager_handler.h" |
| 30 #include "chrome/browser/dom_ui/stop_syncing_handler.h" | 31 #include "chrome/browser/dom_ui/stop_syncing_handler.h" |
| 31 #include "chrome/browser/dom_ui/sync_options_handler.h" | 32 #include "chrome/browser/dom_ui/sync_options_handler.h" |
| 32 #include "chrome/browser/dom_ui/dom_ui_theme_source.h" | 33 #include "chrome/browser/dom_ui/dom_ui_theme_source.h" |
| 33 #include "chrome/browser/metrics/user_metrics.h" | 34 #include "chrome/browser/metrics/user_metrics.h" |
| 34 #include "chrome/browser/pref_service.h" | 35 #include "chrome/browser/pref_service.h" |
| 35 #include "chrome/browser/profile.h" | 36 #include "chrome/browser/profile.h" |
| 36 #include "chrome/browser/tab_contents/tab_contents.h" | 37 #include "chrome/browser/tab_contents/tab_contents.h" |
| 37 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 38 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 #else | 126 #else |
| 126 AddOptionsPageUIHandler(localized_strings, new CoreOptionsHandler()); | 127 AddOptionsPageUIHandler(localized_strings, new CoreOptionsHandler()); |
| 127 #endif | 128 #endif |
| 128 | 129 |
| 129 AddOptionsPageUIHandler(localized_strings, new AddStartupPageHandler()); | 130 AddOptionsPageUIHandler(localized_strings, new AddStartupPageHandler()); |
| 130 AddOptionsPageUIHandler(localized_strings, new AdvancedOptionsHandler()); | 131 AddOptionsPageUIHandler(localized_strings, new AdvancedOptionsHandler()); |
| 131 AddOptionsPageUIHandler(localized_strings, new BrowserOptionsHandler()); | 132 AddOptionsPageUIHandler(localized_strings, new BrowserOptionsHandler()); |
| 132 AddOptionsPageUIHandler(localized_strings, new ClearBrowserDataHandler()); | 133 AddOptionsPageUIHandler(localized_strings, new ClearBrowserDataHandler()); |
| 133 AddOptionsPageUIHandler(localized_strings, new ContentSettingsHandler()); | 134 AddOptionsPageUIHandler(localized_strings, new ContentSettingsHandler()); |
| 134 AddOptionsPageUIHandler(localized_strings, new FontSettingsHandler()); | 135 AddOptionsPageUIHandler(localized_strings, new FontSettingsHandler()); |
| 136 AddOptionsPageUIHandler(localized_strings, new PasswordsExceptionsHandler()); |
| 135 AddOptionsPageUIHandler(localized_strings, new PersonalOptionsHandler()); | 137 AddOptionsPageUIHandler(localized_strings, new PersonalOptionsHandler()); |
| 136 AddOptionsPageUIHandler(localized_strings, new SearchEngineManagerHandler()); | 138 AddOptionsPageUIHandler(localized_strings, new SearchEngineManagerHandler()); |
| 137 AddOptionsPageUIHandler(localized_strings, new ImportDataHandler()); | 139 AddOptionsPageUIHandler(localized_strings, new ImportDataHandler()); |
| 138 AddOptionsPageUIHandler(localized_strings, new StopSyncingHandler()); | 140 AddOptionsPageUIHandler(localized_strings, new StopSyncingHandler()); |
| 139 AddOptionsPageUIHandler(localized_strings, new SyncOptionsHandler()); | 141 AddOptionsPageUIHandler(localized_strings, new SyncOptionsHandler()); |
| 140 #if defined(OS_CHROMEOS) | 142 #if defined(OS_CHROMEOS) |
| 141 AddOptionsPageUIHandler(localized_strings, | 143 AddOptionsPageUIHandler(localized_strings, |
| 142 new chromeos::AccountsOptionsHandler()); | 144 new chromeos::AccountsOptionsHandler()); |
| 143 AddOptionsPageUIHandler(localized_strings, new InternetOptionsHandler()); | 145 AddOptionsPageUIHandler(localized_strings, new InternetOptionsHandler()); |
| 144 AddOptionsPageUIHandler(localized_strings, new LabsHandler()); | 146 AddOptionsPageUIHandler(localized_strings, new LabsHandler()); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 (static_cast<OptionsPageUIHandler*>(*iter))->Initialize(); | 192 (static_cast<OptionsPageUIHandler*>(*iter))->Initialize(); |
| 191 } | 193 } |
| 192 } | 194 } |
| 193 | 195 |
| 194 void OptionsUI::AddOptionsPageUIHandler(DictionaryValue* localized_strings, | 196 void OptionsUI::AddOptionsPageUIHandler(DictionaryValue* localized_strings, |
| 195 OptionsPageUIHandler* handler) { | 197 OptionsPageUIHandler* handler) { |
| 196 DCHECK(handler); | 198 DCHECK(handler); |
| 197 handler->GetLocalizedValues(localized_strings); | 199 handler->GetLocalizedValues(localized_strings); |
| 198 AddMessageHandler(handler->Attach(this)); | 200 AddMessageHandler(handler->Attach(this)); |
| 199 } | 201 } |
| OLD | NEW |