| 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/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/about_page_handler.h" | 19 #include "chrome/browser/dom_ui/about_page_handler.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/autofill_edit_address_handler.h" | 22 #include "chrome/browser/dom_ui/autofill_edit_address_handler.h" |
| 23 #include "chrome/browser/dom_ui/autofill_edit_creditcard_handler.h" |
| 23 #include "chrome/browser/dom_ui/autofill_options_handler.h" | 24 #include "chrome/browser/dom_ui/autofill_options_handler.h" |
| 24 #include "chrome/browser/dom_ui/browser_options_handler.h" | 25 #include "chrome/browser/dom_ui/browser_options_handler.h" |
| 25 #include "chrome/browser/dom_ui/clear_browser_data_handler.h" | 26 #include "chrome/browser/dom_ui/clear_browser_data_handler.h" |
| 26 #include "chrome/browser/dom_ui/content_settings_handler.h" | 27 #include "chrome/browser/dom_ui/content_settings_handler.h" |
| 27 #include "chrome/browser/dom_ui/core_options_handler.h" | 28 #include "chrome/browser/dom_ui/core_options_handler.h" |
| 28 #include "chrome/browser/dom_ui/dom_ui_theme_source.h" | 29 #include "chrome/browser/dom_ui/dom_ui_theme_source.h" |
| 29 #include "chrome/browser/dom_ui/font_settings_handler.h" | 30 #include "chrome/browser/dom_ui/font_settings_handler.h" |
| 30 #include "chrome/browser/dom_ui/import_data_handler.h" | 31 #include "chrome/browser/dom_ui/import_data_handler.h" |
| 31 #include "chrome/browser/dom_ui/passwords_exceptions_handler.h" | 32 #include "chrome/browser/dom_ui/passwords_exceptions_handler.h" |
| 32 #include "chrome/browser/dom_ui/passwords_remove_all_handler.h" | 33 #include "chrome/browser/dom_ui/passwords_remove_all_handler.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 #if defined(OS_CHROMEOS) | 128 #if defined(OS_CHROMEOS) |
| 128 AddOptionsPageUIHandler(localized_strings, | 129 AddOptionsPageUIHandler(localized_strings, |
| 129 new chromeos::CoreChromeOSOptionsHandler()); | 130 new chromeos::CoreChromeOSOptionsHandler()); |
| 130 #else | 131 #else |
| 131 AddOptionsPageUIHandler(localized_strings, new CoreOptionsHandler()); | 132 AddOptionsPageUIHandler(localized_strings, new CoreOptionsHandler()); |
| 132 #endif | 133 #endif |
| 133 | 134 |
| 134 AddOptionsPageUIHandler(localized_strings, new AddStartupPageHandler()); | 135 AddOptionsPageUIHandler(localized_strings, new AddStartupPageHandler()); |
| 135 AddOptionsPageUIHandler(localized_strings, new AdvancedOptionsHandler()); | 136 AddOptionsPageUIHandler(localized_strings, new AdvancedOptionsHandler()); |
| 136 AddOptionsPageUIHandler(localized_strings, new AutoFillEditAddressHandler()); | 137 AddOptionsPageUIHandler(localized_strings, new AutoFillEditAddressHandler()); |
| 138 AddOptionsPageUIHandler(localized_strings, |
| 139 new AutoFillEditCreditCardHandler()); |
| 137 AddOptionsPageUIHandler(localized_strings, new AutoFillOptionsHandler()); | 140 AddOptionsPageUIHandler(localized_strings, new AutoFillOptionsHandler()); |
| 138 AddOptionsPageUIHandler(localized_strings, new BrowserOptionsHandler()); | 141 AddOptionsPageUIHandler(localized_strings, new BrowserOptionsHandler()); |
| 139 AddOptionsPageUIHandler(localized_strings, new ClearBrowserDataHandler()); | 142 AddOptionsPageUIHandler(localized_strings, new ClearBrowserDataHandler()); |
| 140 AddOptionsPageUIHandler(localized_strings, new ContentSettingsHandler()); | 143 AddOptionsPageUIHandler(localized_strings, new ContentSettingsHandler()); |
| 141 AddOptionsPageUIHandler(localized_strings, new FontSettingsHandler()); | 144 AddOptionsPageUIHandler(localized_strings, new FontSettingsHandler()); |
| 142 AddOptionsPageUIHandler(localized_strings, new PasswordsExceptionsHandler()); | 145 AddOptionsPageUIHandler(localized_strings, new PasswordsExceptionsHandler()); |
| 143 AddOptionsPageUIHandler(localized_strings, new PasswordsRemoveAllHandler()); | 146 AddOptionsPageUIHandler(localized_strings, new PasswordsRemoveAllHandler()); |
| 144 AddOptionsPageUIHandler(localized_strings, new PersonalOptionsHandler()); | 147 AddOptionsPageUIHandler(localized_strings, new PersonalOptionsHandler()); |
| 145 AddOptionsPageUIHandler(localized_strings, new SearchEngineManagerHandler()); | 148 AddOptionsPageUIHandler(localized_strings, new SearchEngineManagerHandler()); |
| 146 AddOptionsPageUIHandler(localized_strings, new ImportDataHandler()); | 149 AddOptionsPageUIHandler(localized_strings, new ImportDataHandler()); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 (static_cast<OptionsPageUIHandler*>(*iter))->Initialize(); | 206 (static_cast<OptionsPageUIHandler*>(*iter))->Initialize(); |
| 204 } | 207 } |
| 205 } | 208 } |
| 206 | 209 |
| 207 void OptionsUI::AddOptionsPageUIHandler(DictionaryValue* localized_strings, | 210 void OptionsUI::AddOptionsPageUIHandler(DictionaryValue* localized_strings, |
| 208 OptionsPageUIHandler* handler) { | 211 OptionsPageUIHandler* handler) { |
| 209 DCHECK(handler); | 212 DCHECK(handler); |
| 210 handler->GetLocalizedValues(localized_strings); | 213 handler->GetLocalizedValues(localized_strings); |
| 211 AddMessageHandler(handler->Attach(this)); | 214 AddMessageHandler(handler->Attach(this)); |
| 212 } | 215 } |
| OLD | NEW |