| 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 template<> |
| 260 WebUIController* NewWebUI<settings::MdSettingsUI>(WebUI* web_ui, |
| 261 const GURL& url) { |
| 262 return new settings::MdSettingsUI(web_ui, url); |
| 263 } |
| 264 |
| 259 #if defined(ENABLE_EXTENSIONS) | 265 #if defined(ENABLE_EXTENSIONS) |
| 260 // Only create ExtensionWebUI for URLs that are allowed extension bindings, | 266 // Only create ExtensionWebUI for URLs that are allowed extension bindings, |
| 261 // hosted by actual tabs. | 267 // hosted by actual tabs. |
| 262 bool NeedsExtensionWebUI(Profile* profile, const GURL& url) { | 268 bool NeedsExtensionWebUI(Profile* profile, const GURL& url) { |
| 263 if (!profile) | 269 if (!profile) |
| 264 return false; | 270 return false; |
| 265 | 271 |
| 266 const extensions::Extension* extension = | 272 const extensions::Extension* extension = |
| 267 extensions::ExtensionRegistry::Get(profile)->enabled_extensions(). | 273 extensions::ExtensionRegistry::Get(profile)->enabled_extensions(). |
| 268 GetExtensionOrAppByURL(url); | 274 GetExtensionOrAppByURL(url); |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 #endif | 813 #endif |
| 808 | 814 |
| 809 // Android doesn't use the plugins pages. | 815 // Android doesn't use the plugins pages. |
| 810 if (page_url.host() == chrome::kChromeUIPluginsHost) | 816 if (page_url.host() == chrome::kChromeUIPluginsHost) |
| 811 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 817 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
| 812 | 818 |
| 813 #endif | 819 #endif |
| 814 | 820 |
| 815 return NULL; | 821 return NULL; |
| 816 } | 822 } |
| OLD | NEW |