| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 // so inject the correct DomDistillerService from chrome/. | 249 // so inject the correct DomDistillerService from chrome/. |
| 250 content::BrowserContext* browser_context = | 250 content::BrowserContext* browser_context = |
| 251 web_ui->GetWebContents()->GetBrowserContext(); | 251 web_ui->GetWebContents()->GetBrowserContext(); |
| 252 dom_distiller::DomDistillerService* service = | 252 dom_distiller::DomDistillerService* service = |
| 253 dom_distiller::DomDistillerServiceFactory::GetForBrowserContext( | 253 dom_distiller::DomDistillerServiceFactory::GetForBrowserContext( |
| 254 browser_context); | 254 browser_context); |
| 255 return new dom_distiller::DomDistillerUi( | 255 return new dom_distiller::DomDistillerUi( |
| 256 web_ui, service, dom_distiller::kDomDistillerScheme); | 256 web_ui, service, dom_distiller::kDomDistillerScheme); |
| 257 } | 257 } |
| 258 | 258 |
| 259 #if !defined(OS_ANDROID) |
| 260 template<> |
| 261 WebUIController* NewWebUI<settings::MdSettingsUI>(WebUI* web_ui, |
| 262 const GURL& url) { |
| 263 return new settings::MdSettingsUI(web_ui, url); |
| 264 } |
| 265 #endif |
| 266 |
| 259 #if defined(ENABLE_EXTENSIONS) | 267 #if defined(ENABLE_EXTENSIONS) |
| 260 // Only create ExtensionWebUI for URLs that are allowed extension bindings, | 268 // Only create ExtensionWebUI for URLs that are allowed extension bindings, |
| 261 // hosted by actual tabs. | 269 // hosted by actual tabs. |
| 262 bool NeedsExtensionWebUI(Profile* profile, const GURL& url) { | 270 bool NeedsExtensionWebUI(Profile* profile, const GURL& url) { |
| 263 if (!profile) | 271 if (!profile) |
| 264 return false; | 272 return false; |
| 265 | 273 |
| 266 const extensions::Extension* extension = | 274 const extensions::Extension* extension = |
| 267 extensions::ExtensionRegistry::Get(profile)->enabled_extensions(). | 275 extensions::ExtensionRegistry::Get(profile)->enabled_extensions(). |
| 268 GetExtensionOrAppByURL(url); | 276 GetExtensionOrAppByURL(url); |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 #endif | 815 #endif |
| 808 | 816 |
| 809 // Android doesn't use the plugins pages. | 817 // Android doesn't use the plugins pages. |
| 810 if (page_url.host() == chrome::kChromeUIPluginsHost) | 818 if (page_url.host() == chrome::kChromeUIPluginsHost) |
| 811 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 819 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
| 812 | 820 |
| 813 #endif | 821 #endif |
| 814 | 822 |
| 815 return NULL; | 823 return NULL; |
| 816 } | 824 } |
| OLD | NEW |