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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 const GURL& url) { | 161 const GURL& url) { |
162 return new extensions::ExtensionInfoUI(web_ui, url); | 162 return new extensions::ExtensionInfoUI(web_ui, url); |
163 } | 163 } |
164 | 164 |
165 // Special case for older about: handlers. | 165 // Special case for older about: handlers. |
166 template<> | 166 template<> |
167 WebUIController* NewWebUI<AboutUI>(WebUI* web_ui, const GURL& url) { | 167 WebUIController* NewWebUI<AboutUI>(WebUI* web_ui, const GURL& url) { |
168 return new AboutUI(web_ui, url.host()); | 168 return new AboutUI(web_ui, url.host()); |
169 } | 169 } |
170 | 170 |
| 171 #if defined(OS_CHROMEOS) |
| 172 template<> |
| 173 WebUIController* NewWebUI<chromeos::OobeUI>(WebUI* web_ui, const GURL& url) { |
| 174 return new chromeos::OobeUI(web_ui, url); |
| 175 } |
| 176 #endif |
| 177 |
171 // Only create ExtensionWebUI for URLs that are allowed extension bindings, | 178 // Only create ExtensionWebUI for URLs that are allowed extension bindings, |
172 // hosted by actual tabs. | 179 // hosted by actual tabs. |
173 bool NeedsExtensionWebUI(Profile* profile, const GURL& url) { | 180 bool NeedsExtensionWebUI(Profile* profile, const GURL& url) { |
174 ExtensionService* service = profile ? profile->GetExtensionService() : NULL; | 181 ExtensionService* service = profile ? profile->GetExtensionService() : NULL; |
175 return service && service->ExtensionBindingsAllowed(url); | 182 return service && service->ExtensionBindingsAllowed(url); |
176 } | 183 } |
177 | 184 |
178 // Returns a function that can be used to create the right type of WebUI for a | 185 // Returns a function that can be used to create the right type of WebUI for a |
179 // tab, based on its URL. Returns NULL if the URL doesn't have WebUI associated | 186 // tab, based on its URL. Returns NULL if the URL doesn't have WebUI associated |
180 // with it. | 187 // with it. |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 return extensions::ExtensionsUI::GetFaviconResourceBytes(scale_factor); | 613 return extensions::ExtensionsUI::GetFaviconResourceBytes(scale_factor); |
607 #endif | 614 #endif |
608 | 615 |
609 // Android doesn't use the plugins pages. | 616 // Android doesn't use the plugins pages. |
610 if (page_url.host() == chrome::kChromeUIPluginsHost) | 617 if (page_url.host() == chrome::kChromeUIPluginsHost) |
611 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 618 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
612 #endif | 619 #endif |
613 | 620 |
614 return NULL; | 621 return NULL; |
615 } | 622 } |
OLD | NEW |