Chromium Code Reviews| 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/extensions/extension_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 2249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2260 } | 2260 } |
| 2261 | 2261 |
| 2262 bool ExtensionService::ExtensionBindingsAllowed(const GURL& url) { | 2262 bool ExtensionService::ExtensionBindingsAllowed(const GURL& url) { |
| 2263 // Allow bindings for all packaged extensions and component hosted apps. | 2263 // Allow bindings for all packaged extensions and component hosted apps. |
| 2264 const Extension* extension = extensions_.GetExtensionOrAppByURL( | 2264 const Extension* extension = extensions_.GetExtensionOrAppByURL( |
| 2265 ExtensionURLInfo(url)); | 2265 ExtensionURLInfo(url)); |
| 2266 return extension && (!extension->is_hosted_app() || | 2266 return extension && (!extension->is_hosted_app() || |
| 2267 extension->location() == Extension::COMPONENT); | 2267 extension->location() == Extension::COMPONENT); |
| 2268 } | 2268 } |
| 2269 | 2269 |
| 2270 bool ExtensionService::ShouldBlockUrlInBrowserTab(GURL* url) { | |
| 2271 const Extension* extension = extensions_.GetExtensionOrAppByURL( | |
| 2272 ExtensionURLInfo(*url)); | |
| 2273 if (extension && extension->is_platform_app()) { | |
| 2274 *url = GURL(std::string(chrome::kExtensionScheme) + "://invalid/"); | |
|
Mihai Parparita -not on Chrome
2012/09/16 05:37:04
chrome-extension://invalid is used by http://code.
| |
| 2275 return true; | |
| 2276 } | |
| 2277 | |
| 2278 return false; | |
| 2279 } | |
| 2280 | |
| 2270 gfx::Image ExtensionService::GetOmniboxIcon( | 2281 gfx::Image ExtensionService::GetOmniboxIcon( |
| 2271 const std::string& extension_id) { | 2282 const std::string& extension_id) { |
| 2272 return gfx::Image(omnibox_icon_manager_.GetIcon(extension_id)); | 2283 return gfx::Image(omnibox_icon_manager_.GetIcon(extension_id)); |
| 2273 } | 2284 } |
| 2274 | 2285 |
| 2275 gfx::Image ExtensionService::GetOmniboxPopupIcon( | 2286 gfx::Image ExtensionService::GetOmniboxPopupIcon( |
| 2276 const std::string& extension_id) { | 2287 const std::string& extension_id) { |
| 2277 return gfx::Image(omnibox_popup_icon_manager_.GetIcon(extension_id)); | 2288 return gfx::Image(omnibox_popup_icon_manager_.GetIcon(extension_id)); |
| 2278 } | 2289 } |
| 2279 | 2290 |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2625 extensions::ExtensionHost* extension_host) { | 2636 extensions::ExtensionHost* extension_host) { |
| 2626 if (!extension_host) | 2637 if (!extension_host) |
| 2627 return; | 2638 return; |
| 2628 | 2639 |
| 2629 #if !defined(OS_ANDROID) | 2640 #if !defined(OS_ANDROID) |
| 2630 extensions::LaunchPlatformApp(extension_host->profile(), | 2641 extensions::LaunchPlatformApp(extension_host->profile(), |
| 2631 extension_host->extension(), | 2642 extension_host->extension(), |
| 2632 NULL, FilePath()); | 2643 NULL, FilePath()); |
| 2633 #endif | 2644 #endif |
| 2634 } | 2645 } |
| OLD | NEW |