| 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" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 ***************************************************************************/ | 237 ***************************************************************************/ |
| 238 // We must compare hosts only since some of the Web UIs append extra stuff | 238 // We must compare hosts only since some of the Web UIs append extra stuff |
| 239 // after the host name. | 239 // after the host name. |
| 240 // All platform builds of Chrome will need to have a cloud printing | 240 // All platform builds of Chrome will need to have a cloud printing |
| 241 // dialog as backup. It's just that on Chrome OS, it's the only | 241 // dialog as backup. It's just that on Chrome OS, it's the only |
| 242 // print dialog. | 242 // print dialog. |
| 243 if (url.host() == chrome::kChromeUICloudPrintResourcesHost) | 243 if (url.host() == chrome::kChromeUICloudPrintResourcesHost) |
| 244 return &NewWebUI<ExternalWebDialogUI>; | 244 return &NewWebUI<ExternalWebDialogUI>; |
| 245 if (url.host() == chrome::kChromeUICloudPrintSetupHost) | 245 if (url.host() == chrome::kChromeUICloudPrintSetupHost) |
| 246 return &NewWebUI<WebDialogUI>; | 246 return &NewWebUI<WebDialogUI>; |
| 247 if (url.host() == chrome::kChromeUIComponentsHost) | |
| 248 return &NewWebUI<ComponentsUI>; | |
| 249 if (url.spec() == chrome::kChromeUIConstrainedHTMLTestURL) | 247 if (url.spec() == chrome::kChromeUIConstrainedHTMLTestURL) |
| 250 return &NewWebUI<ConstrainedWebDialogUI>; | 248 return &NewWebUI<ConstrainedWebDialogUI>; |
| 251 if (url.host() == chrome::kChromeUICrashesHost) | 249 if (url.host() == chrome::kChromeUICrashesHost) |
| 252 return &NewWebUI<CrashesUI>; | 250 return &NewWebUI<CrashesUI>; |
| 253 #if defined(ENABLE_MDNS) | 251 #if defined(ENABLE_MDNS) |
| 254 if (url.host() == chrome::kChromeUIDevicesHost && | 252 if (url.host() == chrome::kChromeUIDevicesHost && |
| 255 !CommandLine::ForCurrentProcess()->HasSwitch( | 253 !CommandLine::ForCurrentProcess()->HasSwitch( |
| 256 switches::kDisableDeviceDiscovery)) { | 254 switches::kDisableDeviceDiscovery)) { |
| 257 return &NewWebUI<LocalDiscoveryUI>; | 255 return &NewWebUI<LocalDiscoveryUI>; |
| 258 } | 256 } |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 // remote devtools on the host machine, and other elements (Shared Workers, | 344 // remote devtools on the host machine, and other elements (Shared Workers, |
| 347 // extensions, etc) aren't supported. | 345 // extensions, etc) aren't supported. |
| 348 if (url.host() == chrome::kChromeUIInspectHost) | 346 if (url.host() == chrome::kChromeUIInspectHost) |
| 349 return &NewWebUI<InspectUI>; | 347 return &NewWebUI<InspectUI>; |
| 350 // Performance monitoring page is not on Android for now. | 348 // Performance monitoring page is not on Android for now. |
| 351 if (url.host() == chrome::kChromeUIPerformanceMonitorHost) | 349 if (url.host() == chrome::kChromeUIPerformanceMonitorHost) |
| 352 return &NewWebUI<performance_monitor::PerformanceMonitorUI>; | 350 return &NewWebUI<performance_monitor::PerformanceMonitorUI>; |
| 353 // Android does not support plugins for now. | 351 // Android does not support plugins for now. |
| 354 if (url.host() == chrome::kChromeUIPluginsHost) | 352 if (url.host() == chrome::kChromeUIPluginsHost) |
| 355 return &NewWebUI<PluginsUI>; | 353 return &NewWebUI<PluginsUI>; |
| 354 // Android does not support components for now. |
| 355 if (url.host() == chrome::kChromeUIComponentsHost) |
| 356 return &NewWebUI<ComponentsUI>; |
| 356 // Settings are implemented with native UI elements on Android. | 357 // Settings are implemented with native UI elements on Android. |
| 357 if (url.host() == chrome::kChromeUISettingsFrameHost) | 358 if (url.host() == chrome::kChromeUISettingsFrameHost) |
| 358 return &NewWebUI<options::OptionsUI>; | 359 return &NewWebUI<options::OptionsUI>; |
| 359 if (url.host() == chrome::kChromeUISuggestionsInternalsHost) | 360 if (url.host() == chrome::kChromeUISuggestionsInternalsHost) |
| 360 return &NewWebUI<SuggestionsInternalsUI>; | 361 return &NewWebUI<SuggestionsInternalsUI>; |
| 361 if (url.host() == chrome::kChromeUISyncFileSystemInternalsHost) | 362 if (url.host() == chrome::kChromeUISyncFileSystemInternalsHost) |
| 362 return &NewWebUI<SyncFileSystemInternalsUI>; | 363 return &NewWebUI<SyncFileSystemInternalsUI>; |
| 363 if (url.host() == chrome::kChromeUISystemInfoHost) | 364 if (url.host() == chrome::kChromeUISystemInfoHost) |
| 364 return &NewWebUI<SystemInfoUI>; | 365 return &NewWebUI<SystemInfoUI>; |
| 365 // Uber frame is not used on Android. | 366 // Uber frame is not used on Android. |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 // The extension scheme is handled in GetFaviconForURL. | 611 // The extension scheme is handled in GetFaviconForURL. |
| 611 if (page_url.SchemeIs(extensions::kExtensionScheme)) { | 612 if (page_url.SchemeIs(extensions::kExtensionScheme)) { |
| 612 NOTREACHED(); | 613 NOTREACHED(); |
| 613 return NULL; | 614 return NULL; |
| 614 } | 615 } |
| 615 #endif | 616 #endif |
| 616 | 617 |
| 617 if (!content::HasWebUIScheme(page_url)) | 618 if (!content::HasWebUIScheme(page_url)) |
| 618 return NULL; | 619 return NULL; |
| 619 | 620 |
| 620 if (page_url.host() == chrome::kChromeUIComponentsHost) | |
| 621 return ComponentsUI::GetFaviconResourceBytes(scale_factor); | |
| 622 return NULL; | |
| 623 | |
| 624 #if defined(OS_WIN) | 621 #if defined(OS_WIN) |
| 625 if (page_url.host() == chrome::kChromeUIConflictsHost) | 622 if (page_url.host() == chrome::kChromeUIConflictsHost) |
| 626 return ConflictsUI::GetFaviconResourceBytes(scale_factor); | 623 return ConflictsUI::GetFaviconResourceBytes(scale_factor); |
| 627 #endif | 624 #endif |
| 628 | 625 |
| 629 if (page_url.host() == chrome::kChromeUICrashesHost) | 626 if (page_url.host() == chrome::kChromeUICrashesHost) |
| 630 return CrashesUI::GetFaviconResourceBytes(scale_factor); | 627 return CrashesUI::GetFaviconResourceBytes(scale_factor); |
| 631 | 628 |
| 632 if (page_url.host() == chrome::kChromeUIFlagsHost) | 629 if (page_url.host() == chrome::kChromeUIFlagsHost) |
| 633 return FlagsUI::GetFaviconResourceBytes(scale_factor); | 630 return FlagsUI::GetFaviconResourceBytes(scale_factor); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 656 #if defined(ENABLE_EXTENSIONS) | 653 #if defined(ENABLE_EXTENSIONS) |
| 657 if (page_url.host() == chrome::kChromeUIExtensionsHost || | 654 if (page_url.host() == chrome::kChromeUIExtensionsHost || |
| 658 page_url.host() == chrome::kChromeUIExtensionsFrameHost) | 655 page_url.host() == chrome::kChromeUIExtensionsFrameHost) |
| 659 return extensions::ExtensionsUI::GetFaviconResourceBytes(scale_factor); | 656 return extensions::ExtensionsUI::GetFaviconResourceBytes(scale_factor); |
| 660 #endif | 657 #endif |
| 661 | 658 |
| 662 // Android doesn't use the plugins pages. | 659 // Android doesn't use the plugins pages. |
| 663 if (page_url.host() == chrome::kChromeUIPluginsHost) | 660 if (page_url.host() == chrome::kChromeUIPluginsHost) |
| 664 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 661 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
| 665 | 662 |
| 663 // Android doesn't use the components pages. |
| 664 if (page_url.host() == chrome::kChromeUIComponentsHost) |
| 665 return ComponentsUI::GetFaviconResourceBytes(scale_factor); |
| 666 #endif | 666 #endif |
| 667 |
| 668 return NULL; |
| 667 } | 669 } |
| OLD | NEW |