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_proxy.h" | 10 #include "base/message_loop_proxy.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 // after the host name. | 192 // after the host name. |
193 // All platform builds of Chrome will need to have a cloud printing | 193 // All platform builds of Chrome will need to have a cloud printing |
194 // dialog as backup. It's just that on Chrome OS, it's the only | 194 // dialog as backup. It's just that on Chrome OS, it's the only |
195 // print dialog. | 195 // print dialog. |
196 if (url.host() == chrome::kChromeUICloudPrintResourcesHost) | 196 if (url.host() == chrome::kChromeUICloudPrintResourcesHost) |
197 return &NewWebUI<ExternalWebDialogUI>; | 197 return &NewWebUI<ExternalWebDialogUI>; |
198 if (url.host() == chrome::kChromeUICloudPrintSetupHost) | 198 if (url.host() == chrome::kChromeUICloudPrintSetupHost) |
199 return &NewWebUI<WebDialogUI>; | 199 return &NewWebUI<WebDialogUI>; |
200 if (url.spec() == chrome::kChromeUIConstrainedHTMLTestURL) | 200 if (url.spec() == chrome::kChromeUIConstrainedHTMLTestURL) |
201 return &NewWebUI<ConstrainedWebDialogUI>; | 201 return &NewWebUI<ConstrainedWebDialogUI>; |
| 202 if (url.host() == chrome::kChromeUIFlagsHost) |
| 203 return &NewWebUI<FlagsUI>; |
202 if (url.host() == chrome::kChromeUIGpuInternalsHost) | 204 if (url.host() == chrome::kChromeUIGpuInternalsHost) |
203 return &NewWebUI<GpuInternalsUI>; | 205 return &NewWebUI<GpuInternalsUI>; |
204 if (url.host() == chrome::kChromeUIHistoryFrameHost) | 206 if (url.host() == chrome::kChromeUIHistoryFrameHost) |
205 return &NewWebUI<HistoryUI>; | 207 return &NewWebUI<HistoryUI>; |
206 if (url.host() == chrome::kChromeUIInstantHost) | 208 if (url.host() == chrome::kChromeUIInstantHost) |
207 return &NewWebUI<InstantUI>; | 209 return &NewWebUI<InstantUI>; |
208 if (url.host() == chrome::kChromeUILocalOmniboxPopupHost) | 210 if (url.host() == chrome::kChromeUILocalOmniboxPopupHost) |
209 return &NewWebUI<LocalOmniboxPopupUI>; | 211 return &NewWebUI<LocalOmniboxPopupUI>; |
210 if (url.host() == chrome::kChromeUIMediaInternalsHost) | 212 if (url.host() == chrome::kChromeUIMediaInternalsHost) |
211 return &NewWebUI<MediaInternalsUI>; | 213 return &NewWebUI<MediaInternalsUI>; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 if (url.host() == chrome::kChromeUIDevToolsHost) | 252 if (url.host() == chrome::kChromeUIDevToolsHost) |
251 return &NewWebUI<DevToolsUI>; | 253 return &NewWebUI<DevToolsUI>; |
252 // Downloads list on Android uses the built-in download manager. | 254 // Downloads list on Android uses the built-in download manager. |
253 if (url.host() == chrome::kChromeUIDownloadsHost) | 255 if (url.host() == chrome::kChromeUIDownloadsHost) |
254 return &NewWebUI<DownloadsUI>; | 256 return &NewWebUI<DownloadsUI>; |
255 if (url.host() == chrome::kChromeUIDialogHost) | 257 if (url.host() == chrome::kChromeUIDialogHost) |
256 return &NewWebUI<ConstrainedWebDialogUI>; | 258 return &NewWebUI<ConstrainedWebDialogUI>; |
257 // Feedback on Android uses the built-in feedback app. | 259 // Feedback on Android uses the built-in feedback app. |
258 if (url.host() == chrome::kChromeUIFeedbackHost) | 260 if (url.host() == chrome::kChromeUIFeedbackHost) |
259 return &NewWebUI<FeedbackUI>; | 261 return &NewWebUI<FeedbackUI>; |
260 // chrome://flags is currently unsupported on Android. | |
261 // TODO(satish): Enable after http://crbug.com/143146 is fixed. | |
262 if (url.host() == chrome::kChromeUIFlagsHost) | |
263 return &NewWebUI<FlagsUI>; | |
264 // Flash is not available on android. | 262 // Flash is not available on android. |
265 if (url.host() == chrome::kChromeUIFlashHost) | 263 if (url.host() == chrome::kChromeUIFlashHost) |
266 return &NewWebUI<FlashUI>; | 264 return &NewWebUI<FlashUI>; |
267 // Help is implemented with native UI elements on Android. | 265 // Help is implemented with native UI elements on Android. |
268 if (url.host() == chrome::kChromeUIHelpFrameHost) | 266 if (url.host() == chrome::kChromeUIHelpFrameHost) |
269 return &NewWebUI<HelpUI>; | 267 return &NewWebUI<HelpUI>; |
270 // chrome://inspect isn't supported on Android. Page debugging is handled by a | 268 // chrome://inspect isn't supported on Android. Page debugging is handled by a |
271 // remote devtools on the host machine, and other elements (Shared Workers, | 269 // remote devtools on the host machine, and other elements (Shared Workers, |
272 // extensions, etc) aren't supported. | 270 // extensions, etc) aren't supported. |
273 if (url.host() == chrome::kChromeUIInspectHost) | 271 if (url.host() == chrome::kChromeUIInspectHost) |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 return NULL; | 586 return NULL; |
589 | 587 |
590 #if defined(OS_WIN) | 588 #if defined(OS_WIN) |
591 if (page_url.host() == chrome::kChromeUIConflictsHost) | 589 if (page_url.host() == chrome::kChromeUIConflictsHost) |
592 return ConflictsUI::GetFaviconResourceBytes(scale_factor); | 590 return ConflictsUI::GetFaviconResourceBytes(scale_factor); |
593 #endif | 591 #endif |
594 | 592 |
595 if (page_url.host() == chrome::kChromeUICrashesHost) | 593 if (page_url.host() == chrome::kChromeUICrashesHost) |
596 return CrashesUI::GetFaviconResourceBytes(scale_factor); | 594 return CrashesUI::GetFaviconResourceBytes(scale_factor); |
597 | 595 |
| 596 if (page_url.host() == chrome::kChromeUIFlagsHost) |
| 597 return FlagsUI::GetFaviconResourceBytes(scale_factor); |
| 598 |
598 if (page_url.host() == chrome::kChromeUIHistoryHost) | 599 if (page_url.host() == chrome::kChromeUIHistoryHost) |
599 return HistoryUI::GetFaviconResourceBytes(scale_factor); | 600 return HistoryUI::GetFaviconResourceBytes(scale_factor); |
600 | 601 |
601 #if !defined(OS_ANDROID) | 602 #if !defined(OS_ANDROID) |
602 // Flash is not available on android. | 603 // Flash is not available on android. |
603 if (page_url.host() == chrome::kChromeUIFlashHost) | 604 if (page_url.host() == chrome::kChromeUIFlashHost) |
604 return FlashUI::GetFaviconResourceBytes(scale_factor); | 605 return FlashUI::GetFaviconResourceBytes(scale_factor); |
605 | 606 |
606 // Android uses the native download manager. | 607 // Android uses the native download manager. |
607 if (page_url.host() == chrome::kChromeUIDownloadsHost) | 608 if (page_url.host() == chrome::kChromeUIDownloadsHost) |
608 return DownloadsUI::GetFaviconResourceBytes(scale_factor); | 609 return DownloadsUI::GetFaviconResourceBytes(scale_factor); |
609 | 610 |
610 // chrome://flags is currently unsupported on Android. | |
611 // TODO(satish): Enable after http://crbug.com/143146 is fixed. | |
612 if (page_url.host() == chrome::kChromeUIFlagsHost) | |
613 return FlagsUI::GetFaviconResourceBytes(scale_factor); | |
614 | |
615 // Android doesn't use the Options pages. | 611 // Android doesn't use the Options pages. |
616 if (page_url.host() == chrome::kChromeUISettingsFrameHost) | 612 if (page_url.host() == chrome::kChromeUISettingsFrameHost) |
617 return options::OptionsUI::GetFaviconResourceBytes(scale_factor); | 613 return options::OptionsUI::GetFaviconResourceBytes(scale_factor); |
618 | 614 |
619 // Android doesn't use the plugins pages. | 615 // Android doesn't use the plugins pages. |
620 if (page_url.host() == chrome::kChromeUIPluginsHost) | 616 if (page_url.host() == chrome::kChromeUIPluginsHost) |
621 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 617 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
622 #endif | 618 #endif |
623 | 619 |
624 return NULL; | 620 return NULL; |
625 } | 621 } |
OLD | NEW |