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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 template<> | 195 template<> |
196 WebUIController* NewWebUI<dom_distiller::DomDistillerUi>(WebUI* web_ui, | 196 WebUIController* NewWebUI<dom_distiller::DomDistillerUi>(WebUI* web_ui, |
197 const GURL& url) { | 197 const GURL& url) { |
198 // The DomDistillerUi can not depend on components/dom_distiller/content, | 198 // The DomDistillerUi can not depend on components/dom_distiller/content, |
199 // so inject the correct DomDistillerService from chrome/. | 199 // so inject the correct DomDistillerService from chrome/. |
200 content::BrowserContext* browser_context = | 200 content::BrowserContext* browser_context = |
201 web_ui->GetWebContents()->GetBrowserContext(); | 201 web_ui->GetWebContents()->GetBrowserContext(); |
202 dom_distiller::DomDistillerService* service = | 202 dom_distiller::DomDistillerService* service = |
203 dom_distiller::DomDistillerServiceFactory::GetForBrowserContext( | 203 dom_distiller::DomDistillerServiceFactory::GetForBrowserContext( |
204 browser_context); | 204 browser_context); |
205 // TODO(nyquist): Add real scheme. | 205 return new dom_distiller::DomDistillerUi(web_ui, |
206 return new dom_distiller::DomDistillerUi(web_ui, service, "dummy"); | 206 service, |
| 207 chrome::kDomDistillerScheme); |
207 } | 208 } |
208 | 209 |
209 // Only create ExtensionWebUI for URLs that are allowed extension bindings, | 210 // Only create ExtensionWebUI for URLs that are allowed extension bindings, |
210 // hosted by actual tabs. | 211 // hosted by actual tabs. |
211 bool NeedsExtensionWebUI(Profile* profile, const GURL& url) { | 212 bool NeedsExtensionWebUI(Profile* profile, const GURL& url) { |
212 ExtensionService* service = profile ? profile->GetExtensionService() : NULL; | 213 ExtensionService* service = profile ? profile->GetExtensionService() : NULL; |
213 return service && service->ExtensionBindingsAllowed(url); | 214 return service && service->ExtensionBindingsAllowed(url); |
214 } | 215 } |
215 | 216 |
216 // Returns a function that can be used to create the right type of WebUI for a | 217 // Returns a function that can be used to create the right type of WebUI for a |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 page_url.host() == chrome::kChromeUIExtensionsFrameHost) | 659 page_url.host() == chrome::kChromeUIExtensionsFrameHost) |
659 return extensions::ExtensionsUI::GetFaviconResourceBytes(scale_factor); | 660 return extensions::ExtensionsUI::GetFaviconResourceBytes(scale_factor); |
660 #endif | 661 #endif |
661 | 662 |
662 // Android doesn't use the plugins pages. | 663 // Android doesn't use the plugins pages. |
663 if (page_url.host() == chrome::kChromeUIPluginsHost) | 664 if (page_url.host() == chrome::kChromeUIPluginsHost) |
664 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 665 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
665 | 666 |
666 #endif | 667 #endif |
667 } | 668 } |
OLD | NEW |