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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 const GURL& url) { | 156 const GURL& url) { |
157 return new ExtensionInfoUI(web_ui, url); | 157 return new ExtensionInfoUI(web_ui, url); |
158 } | 158 } |
159 | 159 |
160 // Special case for older about: handlers. | 160 // Special case for older about: handlers. |
161 template<> | 161 template<> |
162 WebUIController* NewWebUI<AboutUI>(WebUI* web_ui, const GURL& url) { | 162 WebUIController* NewWebUI<AboutUI>(WebUI* web_ui, const GURL& url) { |
163 return new AboutUI(web_ui, url.host()); | 163 return new AboutUI(web_ui, url.host()); |
164 } | 164 } |
165 | 165 |
| 166 template<> |
| 167 WebUIController* NewWebUI<chromeos::OobeUI>(WebUI* web_ui, const GURL& url) { |
| 168 return new chromeos::OobeUI(web_ui, url); |
| 169 } |
| 170 |
166 // Only create ExtensionWebUI for URLs that are allowed extension bindings, | 171 // Only create ExtensionWebUI for URLs that are allowed extension bindings, |
167 // hosted by actual tabs. | 172 // hosted by actual tabs. |
168 bool NeedsExtensionWebUI(Profile* profile, const GURL& url) { | 173 bool NeedsExtensionWebUI(Profile* profile, const GURL& url) { |
169 ExtensionService* service = profile ? profile->GetExtensionService() : NULL; | 174 ExtensionService* service = profile ? profile->GetExtensionService() : NULL; |
170 return service && service->ExtensionBindingsAllowed(url); | 175 return service && service->ExtensionBindingsAllowed(url); |
171 } | 176 } |
172 | 177 |
173 // Returns a function that can be used to create the right type of WebUI for a | 178 // Returns a function that can be used to create the right type of WebUI for a |
174 // tab, based on its URL. Returns NULL if the URL doesn't have WebUI associated | 179 // tab, based on its URL. Returns NULL if the URL doesn't have WebUI associated |
175 // with it. | 180 // with it. |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 if (page_url.host() == chrome::kChromeUISettingsFrameHost) | 597 if (page_url.host() == chrome::kChromeUISettingsFrameHost) |
593 return options::OptionsUI::GetFaviconResourceBytes(scale_factor); | 598 return options::OptionsUI::GetFaviconResourceBytes(scale_factor); |
594 | 599 |
595 // Android doesn't use the plugins pages. | 600 // Android doesn't use the plugins pages. |
596 if (page_url.host() == chrome::kChromeUIPluginsHost) | 601 if (page_url.host() == chrome::kChromeUIPluginsHost) |
597 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 602 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
598 #endif | 603 #endif |
599 | 604 |
600 return NULL; | 605 return NULL; |
601 } | 606 } |
OLD | NEW |