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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
12 #include "chrome/browser/about_flags.h" | 12 #include "chrome/browser/about_flags.h" |
13 #include "chrome/browser/extensions/extension_service.h" | 13 #include "chrome/browser/extensions/extension_service.h" |
14 #include "chrome/browser/extensions/extension_web_ui.h" | 14 #include "chrome/browser/extensions/extension_web_ui.h" |
15 #include "chrome/browser/history/history_types.h" | 15 #include "chrome/browser/history/history_types.h" |
16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
17 #include "chrome/browser/profiles/profile_manager.h" | 17 #include "chrome/browser/profiles/profile_manager.h" |
18 #include "chrome/browser/ui/webui/about_ui.h" | 18 #include "chrome/browser/ui/webui/about_ui.h" |
19 #include "chrome/browser/ui/webui/app_launcher_page_ui.h" | 19 #include "chrome/browser/ui/webui/app_launcher_page_ui.h" |
20 #include "chrome/browser/ui/webui/bookmarks_ui.h" | 20 #include "chrome/browser/ui/webui/bookmarks_ui.h" |
21 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" | 21 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" |
22 #include "chrome/browser/ui/webui/crashes_ui.h" | 22 #include "chrome/browser/ui/webui/crashes_ui.h" |
23 #include "chrome/browser/ui/webui/devtools_ui.h" | 23 #include "chrome/browser/ui/webui/devtools_ui.h" |
24 #include "chrome/browser/ui/webui/downloads_ui.h" | 24 #include "chrome/browser/ui/webui/downloads_ui.h" |
25 #include "chrome/browser/ui/webui/extensions/extension_activity_ui.h" | |
26 #include "chrome/browser/ui/webui/extensions/extension_info_ui.h" | 25 #include "chrome/browser/ui/webui/extensions/extension_info_ui.h" |
27 #include "chrome/browser/ui/webui/extensions/extensions_ui.h" | 26 #include "chrome/browser/ui/webui/extensions/extensions_ui.h" |
28 #include "chrome/browser/ui/webui/feedback_ui.h" | 27 #include "chrome/browser/ui/webui/feedback_ui.h" |
29 #include "chrome/browser/ui/webui/flags_ui.h" | 28 #include "chrome/browser/ui/webui/flags_ui.h" |
30 #include "chrome/browser/ui/webui/flash_ui.h" | 29 #include "chrome/browser/ui/webui/flash_ui.h" |
31 #include "chrome/browser/ui/webui/help/help_ui.h" | 30 #include "chrome/browser/ui/webui/help/help_ui.h" |
32 #include "chrome/browser/ui/webui/history_ui.h" | 31 #include "chrome/browser/ui/webui/history_ui.h" |
33 #include "chrome/browser/ui/webui/inline_login_ui.h" | 32 #include "chrome/browser/ui/webui/inline_login_ui.h" |
34 #include "chrome/browser/ui/webui/inspect_ui.h" | 33 #include "chrome/browser/ui/webui/inspect_ui.h" |
35 #include "chrome/browser/ui/webui/instant_ui.h" | 34 #include "chrome/browser/ui/webui/instant_ui.h" |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 || url.host() == chrome::kChromeUITransparencyHost | 403 || url.host() == chrome::kChromeUITransparencyHost |
405 #endif | 404 #endif |
406 #if defined(WEBUI_TASK_MANAGER) | 405 #if defined(WEBUI_TASK_MANAGER) |
407 || url.host() == chrome::kChromeUITaskManagerHost | 406 || url.host() == chrome::kChromeUITaskManagerHost |
408 #endif | 407 #endif |
409 ) { | 408 ) { |
410 return &NewWebUI<AboutUI>; | 409 return &NewWebUI<AboutUI>; |
411 } | 410 } |
412 | 411 |
413 #if defined(ENABLE_EXTENSIONS) | 412 #if defined(ENABLE_EXTENSIONS) |
414 if (url.host() == chrome::kChromeUIExtensionActivityHost && | |
415 CommandLine::ForCurrentProcess()->HasSwitch( | |
416 switches::kEnableExtensionActivityUI)) { | |
417 return &NewWebUI<ExtensionActivityUI>; | |
418 } | |
419 if (url.host() == chrome::kChromeUIExtensionInfoHost && | 413 if (url.host() == chrome::kChromeUIExtensionInfoHost && |
420 extensions::FeatureSwitch::script_badges()->IsEnabled()) { | 414 extensions::FeatureSwitch::script_badges()->IsEnabled()) { |
421 return &NewWebUI<ExtensionInfoUI>; | 415 return &NewWebUI<ExtensionInfoUI>; |
422 } | 416 } |
423 if (url.host() == chrome::kChromeUIExtensionsFrameHost) | 417 if (url.host() == chrome::kChromeUIExtensionsFrameHost) |
424 return &NewWebUI<ExtensionsUI>; | 418 return &NewWebUI<ExtensionsUI>; |
425 #endif | 419 #endif |
426 #if defined(ENABLE_PRINTING) | 420 #if defined(ENABLE_PRINTING) |
427 if (url.host() == chrome::kChromeUIPrintHost && | 421 if (url.host() == chrome::kChromeUIPrintHost && |
428 !profile->GetPrefs()->GetBoolean(prefs::kPrintPreviewDisabled)) | 422 !profile->GetPrefs()->GetBoolean(prefs::kPrintPreviewDisabled)) |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 if (page_url.host() == chrome::kChromeUISettingsFrameHost) | 578 if (page_url.host() == chrome::kChromeUISettingsFrameHost) |
585 return options::OptionsUI::GetFaviconResourceBytes(scale_factor); | 579 return options::OptionsUI::GetFaviconResourceBytes(scale_factor); |
586 | 580 |
587 // Android doesn't use the plugins pages. | 581 // Android doesn't use the plugins pages. |
588 if (page_url.host() == chrome::kChromeUIPluginsHost) | 582 if (page_url.host() == chrome::kChromeUIPluginsHost) |
589 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 583 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
590 #endif | 584 #endif |
591 | 585 |
592 return NULL; | 586 return NULL; |
593 } | 587 } |
OLD | NEW |