| 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/webui/options/options_ui.h" | 5 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/memory/ref_counted_memory.h" | 13 #include "base/memory/ref_counted_memory.h" |
| 14 #include "base/memory/singleton.h" | 14 #include "base/memory/singleton.h" |
| 15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 16 #include "base/strings/string_piece.h" | 16 #include "base/strings/string_piece.h" |
| 17 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
| 18 #include "base/threading/thread.h" | 18 #include "base/threading/thread.h" |
| 19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
| 20 #include "base/values.h" | 20 #include "base/values.h" |
| 21 #include "chrome/browser/autocomplete/autocomplete_match.h" | 21 #include "chrome/browser/autocomplete/autocomplete_match.h" |
| 22 #include "chrome/browser/autocomplete/autocomplete_result.h" | 22 #include "chrome/browser/autocomplete/autocomplete_result.h" |
| 23 #include "chrome/browser/browser_about_handler.h" | 23 #include "chrome/browser/browser_about_handler.h" |
| 24 #include "chrome/browser/browser_process.h" | 24 #include "chrome/browser/browser_process.h" |
| 25 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
| 26 #include "chrome/browser/ui/webui/metrics_handler.h" | 26 #include "chrome/browser/ui/webui/metrics_handler.h" |
| 27 #include "chrome/browser/ui/webui/options/autofill_options_handler.h" | 27 #include "chrome/browser/ui/webui/options/autofill_options_handler.h" |
| 28 #include "chrome/browser/ui/webui/options/automatic_settings_reset_handler.h" |
| 28 #include "chrome/browser/ui/webui/options/browser_options_handler.h" | 29 #include "chrome/browser/ui/webui/options/browser_options_handler.h" |
| 29 #include "chrome/browser/ui/webui/options/clear_browser_data_handler.h" | 30 #include "chrome/browser/ui/webui/options/clear_browser_data_handler.h" |
| 30 #include "chrome/browser/ui/webui/options/content_settings_handler.h" | 31 #include "chrome/browser/ui/webui/options/content_settings_handler.h" |
| 31 #include "chrome/browser/ui/webui/options/cookies_view_handler.h" | 32 #include "chrome/browser/ui/webui/options/cookies_view_handler.h" |
| 32 #include "chrome/browser/ui/webui/options/core_options_handler.h" | 33 #include "chrome/browser/ui/webui/options/core_options_handler.h" |
| 33 #include "chrome/browser/ui/webui/options/create_profile_handler.h" | 34 #include "chrome/browser/ui/webui/options/create_profile_handler.h" |
| 34 #include "chrome/browser/ui/webui/options/font_settings_handler.h" | 35 #include "chrome/browser/ui/webui/options/font_settings_handler.h" |
| 35 #include "chrome/browser/ui/webui/options/handler_options_handler.h" | 36 #include "chrome/browser/ui/webui/options/handler_options_handler.h" |
| 36 #include "chrome/browser/ui/webui/options/home_page_overlay_handler.h" | 37 #include "chrome/browser/ui/webui/options/home_page_overlay_handler.h" |
| 37 #include "chrome/browser/ui/webui/options/import_data_handler.h" | 38 #include "chrome/browser/ui/webui/options/import_data_handler.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 CoreOptionsHandler* core_handler; | 250 CoreOptionsHandler* core_handler; |
| 250 #if defined(OS_CHROMEOS) | 251 #if defined(OS_CHROMEOS) |
| 251 core_handler = new chromeos::options::CoreChromeOSOptionsHandler(); | 252 core_handler = new chromeos::options::CoreChromeOSOptionsHandler(); |
| 252 #else | 253 #else |
| 253 core_handler = new CoreOptionsHandler(); | 254 core_handler = new CoreOptionsHandler(); |
| 254 #endif | 255 #endif |
| 255 core_handler->set_handlers_host(this); | 256 core_handler->set_handlers_host(this); |
| 256 AddOptionsPageUIHandler(localized_strings, core_handler); | 257 AddOptionsPageUIHandler(localized_strings, core_handler); |
| 257 | 258 |
| 258 AddOptionsPageUIHandler(localized_strings, new AutofillOptionsHandler()); | 259 AddOptionsPageUIHandler(localized_strings, new AutofillOptionsHandler()); |
| 260 AddOptionsPageUIHandler(localized_strings, |
| 261 new AutomaticSettingsResetHandler()); |
| 259 | 262 |
| 260 BrowserOptionsHandler* browser_options_handler = new BrowserOptionsHandler(); | 263 BrowserOptionsHandler* browser_options_handler = new BrowserOptionsHandler(); |
| 261 AddOptionsPageUIHandler(localized_strings, browser_options_handler); | 264 AddOptionsPageUIHandler(localized_strings, browser_options_handler); |
| 262 | 265 |
| 263 AddOptionsPageUIHandler(localized_strings, new ClearBrowserDataHandler()); | 266 AddOptionsPageUIHandler(localized_strings, new ClearBrowserDataHandler()); |
| 264 AddOptionsPageUIHandler(localized_strings, new ContentSettingsHandler()); | 267 AddOptionsPageUIHandler(localized_strings, new ContentSettingsHandler()); |
| 265 AddOptionsPageUIHandler(localized_strings, new CookiesViewHandler()); | 268 AddOptionsPageUIHandler(localized_strings, new CookiesViewHandler()); |
| 266 AddOptionsPageUIHandler(localized_strings, new CreateProfileHandler()); | 269 AddOptionsPageUIHandler(localized_strings, new CreateProfileHandler()); |
| 267 AddOptionsPageUIHandler(localized_strings, new FontSettingsHandler()); | 270 AddOptionsPageUIHandler(localized_strings, new FontSettingsHandler()); |
| 268 #if defined(ENABLE_GOOGLE_NOW) | 271 #if defined(ENABLE_GOOGLE_NOW) |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 // Add only if handler's service is enabled. | 439 // Add only if handler's service is enabled. |
| 437 if (handler->IsEnabled()) { | 440 if (handler->IsEnabled()) { |
| 438 // Add handler to the list and also pass the ownership. | 441 // Add handler to the list and also pass the ownership. |
| 439 web_ui()->AddMessageHandler(handler.release()); | 442 web_ui()->AddMessageHandler(handler.release()); |
| 440 handler_raw->GetLocalizedValues(localized_strings); | 443 handler_raw->GetLocalizedValues(localized_strings); |
| 441 handlers_.push_back(handler_raw); | 444 handlers_.push_back(handler_raw); |
| 442 } | 445 } |
| 443 } | 446 } |
| 444 | 447 |
| 445 } // namespace options | 448 } // namespace options |
| OLD | NEW |