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