| 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/chrome_web_ui_controller_factory.h" | 5 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/about_flags.h" | 8 #include "chrome/browser/about_flags.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| 11 #include "chrome/browser/extensions/extension_web_ui.h" | 11 #include "chrome/browser/extensions/extension_web_ui.h" |
| 12 #include "chrome/browser/history/history_types.h" | 12 #include "chrome/browser/history/history_types.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/profiles/profile_manager.h" | 14 #include "chrome/browser/profiles/profile_manager.h" |
| 15 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 15 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 16 #include "chrome/browser/ui/webui/about_page/about_page_ui.h" | 16 #include "chrome/browser/ui/webui/about_page/about_page_ui.h" |
| 17 #include "chrome/browser/ui/webui/about_ui.h" | 17 #include "chrome/browser/ui/webui/about_ui.h" |
| 18 #include "chrome/browser/ui/webui/bookmarks_ui.h" | 18 #include "chrome/browser/ui/webui/bookmarks_ui.h" |
| 19 #include "chrome/browser/ui/webui/constrained_html_ui.h" | 19 #include "chrome/browser/ui/webui/constrained_html_ui.h" |
| 20 #include "chrome/browser/ui/webui/crashes_ui.h" | 20 #include "chrome/browser/ui/webui/crashes_ui.h" |
| 21 #include "chrome/browser/ui/webui/devtools_ui.h" | 21 #include "chrome/browser/ui/webui/devtools_ui.h" |
| 22 #include "chrome/browser/ui/webui/downloads_ui.h" | 22 #include "chrome/browser/ui/webui/downloads_ui.h" |
| 23 #include "chrome/browser/ui/webui/edit_search_engine_dialog_ui_webui.h" | 23 #include "chrome/browser/ui/webui/edit_search_engine_dialog_ui_webui.h" |
| 24 #include "chrome/browser/ui/webui/extensions/extension_activity_ui.h" |
| 24 #include "chrome/browser/ui/webui/extensions/extensions_ui.h" | 25 #include "chrome/browser/ui/webui/extensions/extensions_ui.h" |
| 25 #include "chrome/browser/ui/webui/feedback_ui.h" | 26 #include "chrome/browser/ui/webui/feedback_ui.h" |
| 26 #include "chrome/browser/ui/webui/task_manager_ui.h" | 27 #include "chrome/browser/ui/webui/task_manager_ui.h" |
| 27 #include "chrome/browser/ui/webui/flags_ui.h" | 28 #include "chrome/browser/ui/webui/flags_ui.h" |
| 28 #include "chrome/browser/ui/webui/flash_ui.h" | 29 #include "chrome/browser/ui/webui/flash_ui.h" |
| 29 #include "chrome/browser/ui/webui/gpu_internals_ui.h" | 30 #include "chrome/browser/ui/webui/gpu_internals_ui.h" |
| 30 #include "chrome/browser/ui/webui/history_ui.h" | 31 #include "chrome/browser/ui/webui/history_ui.h" |
| 31 #include "chrome/browser/ui/webui/html_dialog_ui.h" | 32 #include "chrome/browser/ui/webui/html_dialog_ui.h" |
| 32 #include "chrome/browser/ui/webui/hung_renderer_dialog_ui.h" | 33 #include "chrome/browser/ui/webui/hung_renderer_dialog_ui.h" |
| 33 #include "chrome/browser/ui/webui/media/media_internals_ui.h" | 34 #include "chrome/browser/ui/webui/media/media_internals_ui.h" |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 #if defined(OS_CHROMEOS) | 337 #if defined(OS_CHROMEOS) |
| 337 || url.host() == chrome::kChromeUICryptohomeHost | 338 || url.host() == chrome::kChromeUICryptohomeHost |
| 338 || url.host() == chrome::kChromeUIDiscardsHost | 339 || url.host() == chrome::kChromeUIDiscardsHost |
| 339 || url.host() == chrome::kChromeUINetworkHost | 340 || url.host() == chrome::kChromeUINetworkHost |
| 340 || url.host() == chrome::kChromeUIOSCreditsHost | 341 || url.host() == chrome::kChromeUIOSCreditsHost |
| 341 #endif | 342 #endif |
| 342 ) { | 343 ) { |
| 343 return &NewWebUI<AboutUI>; | 344 return &NewWebUI<AboutUI>; |
| 344 } | 345 } |
| 345 | 346 |
| 347 if (url.host() == chrome::kChromeUIExtensionActivityHost && |
| 348 CommandLine::ForCurrentProcess()->HasSwitch( |
| 349 switches::kEnableExtensionActivityUI)) { |
| 350 return &NewWebUI<ExtensionActivityUI>; |
| 351 } |
| 352 |
| 346 DLOG(WARNING) << "Unknown WebUI:" << url; | 353 DLOG(WARNING) << "Unknown WebUI:" << url; |
| 347 return NULL; | 354 return NULL; |
| 348 } | 355 } |
| 349 | 356 |
| 350 // When the test-type switch is set, return a TestType object, which should be a | 357 // When the test-type switch is set, return a TestType object, which should be a |
| 351 // subclass of Type. The logic is provided here in the traits class, rather than | 358 // subclass of Type. The logic is provided here in the traits class, rather than |
| 352 // in GetInstance() so that the choice is made only once, when the Singleton is | 359 // in GetInstance() so that the choice is made only once, when the Singleton is |
| 353 // first instantiated, rather than every time GetInstance() is called. | 360 // first instantiated, rather than every time GetInstance() is called. |
| 354 template<typename Type, typename TestType> | 361 template<typename Type, typename TestType> |
| 355 struct PossibleTestSingletonTraits : public DefaultSingletonTraits<Type> { | 362 struct PossibleTestSingletonTraits : public DefaultSingletonTraits<Type> { |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 return OptionsUI::GetFaviconResourceBytes(); | 501 return OptionsUI::GetFaviconResourceBytes(); |
| 495 | 502 |
| 496 if (page_url.host() == chrome::kChromeUISettingsFrameHost) | 503 if (page_url.host() == chrome::kChromeUISettingsFrameHost) |
| 497 return options2::OptionsUI::GetFaviconResourceBytes(); | 504 return options2::OptionsUI::GetFaviconResourceBytes(); |
| 498 | 505 |
| 499 if (page_url.host() == chrome::kChromeUIPluginsHost) | 506 if (page_url.host() == chrome::kChromeUIPluginsHost) |
| 500 return PluginsUI::GetFaviconResourceBytes(); | 507 return PluginsUI::GetFaviconResourceBytes(); |
| 501 | 508 |
| 502 return NULL; | 509 return NULL; |
| 503 } | 510 } |
| OLD | NEW |