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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/message_loop/message_loop_proxy.h" | 12 #include "base/message_loop/message_loop_proxy.h" |
13 #include "base/prefs/pref_service.h" | 13 #include "base/prefs/pref_service.h" |
14 #include "chrome/browser/about_flags.h" | 14 #include "chrome/browser/about_flags.h" |
15 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" | 15 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" |
16 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" | 16 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" |
17 #include "chrome/browser/favicon/favicon_service.h" | 17 #include "chrome/browser/favicon/favicon_service.h" |
18 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
19 #include "chrome/browser/profiles/profile_manager.h" | 19 #include "chrome/browser/profiles/profile_manager.h" |
20 #include "chrome/browser/ui/webui/about_ui.h" | 20 #include "chrome/browser/ui/webui/about_ui.h" |
21 #include "chrome/browser/ui/webui/app_launcher_page_ui.h" | 21 #include "chrome/browser/ui/webui/app_launcher_page_ui.h" |
22 #include "chrome/browser/ui/webui/bookmarks_ui.h" | 22 #include "chrome/browser/ui/webui/bookmarks_ui.h" |
23 #include "chrome/browser/ui/webui/components_ui.h" | 23 #include "chrome/browser/ui/webui/components_ui.h" |
24 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" | 24 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" |
25 #include "chrome/browser/ui/webui/copresence_ui.h" | |
25 #include "chrome/browser/ui/webui/crashes_ui.h" | 26 #include "chrome/browser/ui/webui/crashes_ui.h" |
26 #include "chrome/browser/ui/webui/domain_reliability_internals_ui.h" | 27 #include "chrome/browser/ui/webui/domain_reliability_internals_ui.h" |
27 #include "chrome/browser/ui/webui/downloads_ui.h" | 28 #include "chrome/browser/ui/webui/downloads_ui.h" |
28 #include "chrome/browser/ui/webui/flags_ui.h" | 29 #include "chrome/browser/ui/webui/flags_ui.h" |
29 #include "chrome/browser/ui/webui/flash_ui.h" | 30 #include "chrome/browser/ui/webui/flash_ui.h" |
30 #include "chrome/browser/ui/webui/gcm_internals_ui.h" | 31 #include "chrome/browser/ui/webui/gcm_internals_ui.h" |
31 #include "chrome/browser/ui/webui/help/help_ui.h" | 32 #include "chrome/browser/ui/webui/help/help_ui.h" |
32 #include "chrome/browser/ui/webui/history_ui.h" | 33 #include "chrome/browser/ui/webui/history_ui.h" |
33 #include "chrome/browser/ui/webui/identity_internals_ui.h" | 34 #include "chrome/browser/ui/webui/identity_internals_ui.h" |
34 #include "chrome/browser/ui/webui/instant_ui.h" | 35 #include "chrome/browser/ui/webui/instant_ui.h" |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
290 // dialog as backup. It's just that on Chrome OS, it's the only | 291 // dialog as backup. It's just that on Chrome OS, it's the only |
291 // print dialog. | 292 // print dialog. |
292 if (url.host() == chrome::kChromeUICloudPrintResourcesHost) | 293 if (url.host() == chrome::kChromeUICloudPrintResourcesHost) |
293 return &NewWebUI<ExternalWebDialogUI>; | 294 return &NewWebUI<ExternalWebDialogUI>; |
294 if (url.host() == chrome::kChromeUICloudPrintSetupHost) | 295 if (url.host() == chrome::kChromeUICloudPrintSetupHost) |
295 return &NewWebUI<WebDialogUI>; | 296 return &NewWebUI<WebDialogUI>; |
296 if (url.host() == chrome::kChromeUIComponentsHost) | 297 if (url.host() == chrome::kChromeUIComponentsHost) |
297 return &NewWebUI<ComponentsUI>; | 298 return &NewWebUI<ComponentsUI>; |
298 if (url.spec() == chrome::kChromeUIConstrainedHTMLTestURL) | 299 if (url.spec() == chrome::kChromeUIConstrainedHTMLTestURL) |
299 return &NewWebUI<ConstrainedWebDialogUI>; | 300 return &NewWebUI<ConstrainedWebDialogUI>; |
301 #if !defined(OS_ANDROID) && !defined(OS_IOS) | |
302 if (url.host() == chrome::kChromeUICopresenceHost) | |
303 return &NewWebUI<CopresenceUI>; | |
304 #endif | |
300 if (url.host() == chrome::kChromeUICrashesHost) | 305 if (url.host() == chrome::kChromeUICrashesHost) |
301 return &NewWebUI<CrashesUI>; | 306 return &NewWebUI<CrashesUI>; |
302 if (url.host() == chrome::kChromeUIDomainReliabilityInternalsHost) | 307 if (url.host() == chrome::kChromeUIDomainReliabilityInternalsHost) |
303 return &NewWebUI<DomainReliabilityInternalsUI>; | 308 return &NewWebUI<DomainReliabilityInternalsUI>; |
304 if (url.host() == chrome::kChromeUIFlagsHost) | 309 if (url.host() == chrome::kChromeUIFlagsHost) |
305 return &NewWebUI<FlagsUI>; | 310 return &NewWebUI<FlagsUI>; |
306 if (url.host() == chrome::kChromeUIHistoryFrameHost) | 311 if (url.host() == chrome::kChromeUIHistoryFrameHost) |
307 return &NewWebUI<HistoryUI>; | 312 return &NewWebUI<HistoryUI>; |
308 if (url.host() == chrome::kChromeUIInstantHost) | 313 if (url.host() == chrome::kChromeUIInstantHost) |
309 return &NewWebUI<InstantUI>; | 314 return &NewWebUI<InstantUI>; |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
441 if (url.host() == chrome::kChromeUISlowTraceHost) | 446 if (url.host() == chrome::kChromeUISlowTraceHost) |
442 return &NewWebUI<chromeos::SlowTraceController>; | 447 return &NewWebUI<chromeos::SlowTraceController>; |
443 if (url.host() == chrome::kChromeUINetworkHost) | 448 if (url.host() == chrome::kChromeUINetworkHost) |
444 return &NewWebUI<chromeos::NetworkUI>; | 449 return &NewWebUI<chromeos::NetworkUI>; |
445 if (url.host() == chrome::kChromeUIPowerHost) | 450 if (url.host() == chrome::kChromeUIPowerHost) |
446 return &NewWebUI<chromeos::PowerUI>; | 451 return &NewWebUI<chromeos::PowerUI>; |
447 #endif // defined(OS_CHROMEOS) | 452 #endif // defined(OS_CHROMEOS) |
448 #if defined(OS_ANDROID) || defined(OS_IOS) | 453 #if defined(OS_ANDROID) || defined(OS_IOS) |
449 if (url.host() == chrome::kChromeUINetExportHost) | 454 if (url.host() == chrome::kChromeUINetExportHost) |
450 return &NewWebUI<NetExportUI>; | 455 return &NewWebUI<NetExportUI>; |
451 #else | 456 #else |
Dan Beam
2014/12/09 05:33:38
nit: put somewhere in here
Charlie
2014/12/17 23:39:55
Done.
| |
452 if (url.host() == chrome::kChromeUIChromeSigninHost) | 457 if (url.host() == chrome::kChromeUIChromeSigninHost) |
453 return &NewWebUI<InlineLoginUI>; | 458 return &NewWebUI<InlineLoginUI>; |
454 if (url.SchemeIs(content::kChromeDevToolsScheme)) | 459 if (url.SchemeIs(content::kChromeDevToolsScheme)) |
455 return &NewWebUI<DevToolsUI>; | 460 return &NewWebUI<DevToolsUI>; |
456 if (url.host() == chrome::kChromeUIWebRTCDeviceProviderHost) | 461 if (url.host() == chrome::kChromeUIWebRTCDeviceProviderHost) |
457 return &NewWebUI<WebRTCDeviceProvider::WebUI>; | 462 return &NewWebUI<WebRTCDeviceProvider::WebUI>; |
458 | 463 |
459 // chrome://inspect isn't supported on Android nor iOS. Page debugging is | 464 // chrome://inspect isn't supported on Android nor iOS. Page debugging is |
460 // handled by a remote devtools on the host machine, and other elements, i.e. | 465 // handled by a remote devtools on the host machine, and other elements, i.e. |
461 // extensions aren't supported. | 466 // extensions aren't supported. |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
721 #endif | 726 #endif |
722 | 727 |
723 // Android doesn't use the plugins pages. | 728 // Android doesn't use the plugins pages. |
724 if (page_url.host() == chrome::kChromeUIPluginsHost) | 729 if (page_url.host() == chrome::kChromeUIPluginsHost) |
725 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 730 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
726 | 731 |
727 #endif | 732 #endif |
728 | 733 |
729 return NULL; | 734 return NULL; |
730 } | 735 } |
OLD | NEW |