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" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 #include "components/favicon_base/favicon_util.h" | 64 #include "components/favicon_base/favicon_util.h" |
65 #include "components/favicon_base/select_favicon_frames.h" | 65 #include "components/favicon_base/select_favicon_frames.h" |
66 #include "components/history/core/browser/history_types.h" | 66 #include "components/history/core/browser/history_types.h" |
67 #include "components/password_manager/core/common/password_manager_switches.h" | 67 #include "components/password_manager/core/common/password_manager_switches.h" |
68 #include "components/signin/core/common/profile_management_switches.h" | 68 #include "components/signin/core/common/profile_management_switches.h" |
69 #include "content/public/browser/web_contents.h" | 69 #include "content/public/browser/web_contents.h" |
70 #include "content/public/browser/web_ui.h" | 70 #include "content/public/browser/web_ui.h" |
71 #include "content/public/common/content_client.h" | 71 #include "content/public/common/content_client.h" |
72 #include "content/public/common/url_utils.h" | 72 #include "content/public/common/url_utils.h" |
73 #include "ui/gfx/favicon_size.h" | 73 #include "ui/gfx/favicon_size.h" |
| 74 #include "ui/oobe/oobe_md_ui.h" |
74 #include "ui/web_dialogs/web_dialog_ui.h" | 75 #include "ui/web_dialogs/web_dialog_ui.h" |
75 #include "url/gurl.h" | 76 #include "url/gurl.h" |
76 | 77 |
77 #if !defined(DISABLE_NACL) | 78 #if !defined(DISABLE_NACL) |
78 #include "chrome/browser/ui/webui/nacl_ui.h" | 79 #include "chrome/browser/ui/webui/nacl_ui.h" |
79 #endif | 80 #endif |
80 | 81 |
81 #if defined(ENABLE_CONFIGURATION_POLICY) | 82 #if defined(ENABLE_CONFIGURATION_POLICY) |
82 #include "chrome/browser/ui/webui/policy_ui.h" | 83 #include "chrome/browser/ui/webui/policy_ui.h" |
83 #endif | 84 #endif |
(...skipping 17 matching lines...) Expand all Loading... |
101 | 102 |
102 #if defined(OS_ANDROID) || defined(OS_IOS) | 103 #if defined(OS_ANDROID) || defined(OS_IOS) |
103 #include "chrome/browser/ui/webui/net_export_ui.h" | 104 #include "chrome/browser/ui/webui/net_export_ui.h" |
104 #else | 105 #else |
105 #include "chrome/browser/devtools/device/webrtc/webrtc_device_provider.h" | 106 #include "chrome/browser/devtools/device/webrtc/webrtc_device_provider.h" |
106 #include "chrome/browser/ui/webui/devtools_ui.h" | 107 #include "chrome/browser/ui/webui/devtools_ui.h" |
107 #include "chrome/browser/ui/webui/inspect_ui.h" | 108 #include "chrome/browser/ui/webui/inspect_ui.h" |
108 #endif | 109 #endif |
109 | 110 |
110 #if defined(OS_CHROMEOS) | 111 #if defined(OS_CHROMEOS) |
| 112 #include "chrome/browser/chromeos/oobe/oobe.h" |
111 #include "chrome/browser/ui/webui/chromeos/bluetooth_pairing_ui.h" | 113 #include "chrome/browser/ui/webui/chromeos/bluetooth_pairing_ui.h" |
112 #include "chrome/browser/ui/webui/chromeos/certificate_manager_dialog_ui.h" | 114 #include "chrome/browser/ui/webui/chromeos/certificate_manager_dialog_ui.h" |
113 #include "chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.h" | 115 #include "chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.h" |
114 #include "chrome/browser/ui/webui/chromeos/cryptohome_ui.h" | 116 #include "chrome/browser/ui/webui/chromeos/cryptohome_ui.h" |
115 #include "chrome/browser/ui/webui/chromeos/drive_internals_ui.h" | 117 #include "chrome/browser/ui/webui/chromeos/drive_internals_ui.h" |
116 #include "chrome/browser/ui/webui/chromeos/first_run/first_run_ui.h" | 118 #include "chrome/browser/ui/webui/chromeos/first_run/first_run_ui.h" |
117 #include "chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.h" | 119 #include "chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.h" |
118 #include "chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.h" | 120 #include "chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.h" |
119 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 121 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
120 #include "chrome/browser/ui/webui/chromeos/mobile_setup_ui.h" | 122 #include "chrome/browser/ui/webui/chromeos/mobile_setup_ui.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 template<> | 201 template<> |
200 WebUIController* NewWebUI<AboutUI>(WebUI* web_ui, const GURL& url) { | 202 WebUIController* NewWebUI<AboutUI>(WebUI* web_ui, const GURL& url) { |
201 return new AboutUI(web_ui, url.host()); | 203 return new AboutUI(web_ui, url.host()); |
202 } | 204 } |
203 | 205 |
204 #if defined(OS_CHROMEOS) | 206 #if defined(OS_CHROMEOS) |
205 template<> | 207 template<> |
206 WebUIController* NewWebUI<chromeos::OobeUI>(WebUI* web_ui, const GURL& url) { | 208 WebUIController* NewWebUI<chromeos::OobeUI>(WebUI* web_ui, const GURL& url) { |
207 return new chromeos::OobeUI(web_ui, url); | 209 return new chromeos::OobeUI(web_ui, url); |
208 } | 210 } |
| 211 |
| 212 template <> |
| 213 WebUIController* NewWebUI<OobeMdUI>(WebUI* web_ui, const GURL& url) { |
| 214 chromeos::Oobe::Register(); |
| 215 return new OobeMdUI(web_ui, url.host()); |
| 216 } |
209 #endif | 217 #endif |
210 | 218 |
211 // Special cases for DOM distiller. | 219 // Special cases for DOM distiller. |
212 template<> | 220 template<> |
213 WebUIController* NewWebUI<dom_distiller::DomDistillerUi>(WebUI* web_ui, | 221 WebUIController* NewWebUI<dom_distiller::DomDistillerUi>(WebUI* web_ui, |
214 const GURL& url) { | 222 const GURL& url) { |
215 // The DomDistillerUi can not depend on components/dom_distiller/content, | 223 // The DomDistillerUi can not depend on components/dom_distiller/content, |
216 // so inject the correct DomDistillerService from chrome/. | 224 // so inject the correct DomDistillerService from chrome/. |
217 content::BrowserContext* browser_context = | 225 content::BrowserContext* browser_context = |
218 web_ui->GetWebContents()->GetBrowserContext(); | 226 web_ui->GetWebContents()->GetBrowserContext(); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 if (url.host() == chrome::kChromeUIFirstRunHost) | 429 if (url.host() == chrome::kChromeUIFirstRunHost) |
422 return &NewWebUI<chromeos::FirstRunUI>; | 430 return &NewWebUI<chromeos::FirstRunUI>; |
423 if (url.host() == chrome::kChromeUIKeyboardOverlayHost) | 431 if (url.host() == chrome::kChromeUIKeyboardOverlayHost) |
424 return &NewWebUI<KeyboardOverlayUI>; | 432 return &NewWebUI<KeyboardOverlayUI>; |
425 if (url.host() == chrome::kChromeUIMobileSetupHost) | 433 if (url.host() == chrome::kChromeUIMobileSetupHost) |
426 return &NewWebUI<MobileSetupUI>; | 434 return &NewWebUI<MobileSetupUI>; |
427 if (url.host() == chrome::kChromeUINfcDebugHost) | 435 if (url.host() == chrome::kChromeUINfcDebugHost) |
428 return &NewWebUI<chromeos::NfcDebugUI>; | 436 return &NewWebUI<chromeos::NfcDebugUI>; |
429 if (url.host() == chrome::kChromeUIOobeHost) | 437 if (url.host() == chrome::kChromeUIOobeHost) |
430 return &NewWebUI<chromeos::OobeUI>; | 438 return &NewWebUI<chromeos::OobeUI>; |
| 439 if (url.host() == chrome::kChromeUIOobeMdHost) |
| 440 return &NewWebUI<OobeMdUI>; |
431 if (url.host() == chrome::kChromeUIProvidedFileSystemsHost) | 441 if (url.host() == chrome::kChromeUIProvidedFileSystemsHost) |
432 return &NewWebUI<chromeos::ProvidedFileSystemsUI>; | 442 return &NewWebUI<chromeos::ProvidedFileSystemsUI>; |
433 if (url.host() == chrome::kChromeUIProxySettingsHost) | 443 if (url.host() == chrome::kChromeUIProxySettingsHost) |
434 return &NewWebUI<chromeos::ProxySettingsUI>; | 444 return &NewWebUI<chromeos::ProxySettingsUI>; |
435 if (url.host() == chrome::kChromeUISalsaHost) | 445 if (url.host() == chrome::kChromeUISalsaHost) |
436 return &NewWebUI<SalsaUI>; | 446 return &NewWebUI<SalsaUI>; |
437 if (url.host() == chrome::kChromeUISetTimeHost) | 447 if (url.host() == chrome::kChromeUISetTimeHost) |
438 return &NewWebUI<chromeos::SetTimeUI>; | 448 return &NewWebUI<chromeos::SetTimeUI>; |
439 if (url.host() == chrome::kChromeUISimUnlockHost) | 449 if (url.host() == chrome::kChromeUISimUnlockHost) |
440 return &NewWebUI<chromeos::SimUnlockUI>; | 450 return &NewWebUI<chromeos::SimUnlockUI>; |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 #endif | 735 #endif |
726 | 736 |
727 // Android doesn't use the plugins pages. | 737 // Android doesn't use the plugins pages. |
728 if (page_url.host() == chrome::kChromeUIPluginsHost) | 738 if (page_url.host() == chrome::kChromeUIPluginsHost) |
729 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 739 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
730 | 740 |
731 #endif | 741 #endif |
732 | 742 |
733 return NULL; | 743 return NULL; |
734 } | 744 } |
OLD | NEW |