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 2265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2276 } | 2276 } |
2277 | 2277 |
2278 bool ExtensionService::ExtensionBindingsAllowed(const GURL& url) { | 2278 bool ExtensionService::ExtensionBindingsAllowed(const GURL& url) { |
2279 // Allow bindings for all packaged extensions and component hosted apps. | 2279 // Allow bindings for all packaged extensions and component hosted apps. |
2280 const Extension* extension = extensions_.GetExtensionOrAppByURL( | 2280 const Extension* extension = extensions_.GetExtensionOrAppByURL( |
2281 ExtensionURLInfo(url)); | 2281 ExtensionURLInfo(url)); |
2282 return extension && (!extension->is_hosted_app() || | 2282 return extension && (!extension->is_hosted_app() || |
2283 extension->location() == Extension::COMPONENT); | 2283 extension->location() == Extension::COMPONENT); |
2284 } | 2284 } |
2285 | 2285 |
| 2286 bool ExtensionService::ShouldBlockUrlInBrowserTab(GURL* url) { |
| 2287 const Extension* extension = extensions_.GetExtensionOrAppByURL( |
| 2288 ExtensionURLInfo(*url)); |
| 2289 if (extension && extension->is_platform_app()) { |
| 2290 *url = GURL(chrome::kExtensionInvalidRequestURL); |
| 2291 return true; |
| 2292 } |
| 2293 |
| 2294 return false; |
| 2295 } |
| 2296 |
2286 gfx::Image ExtensionService::GetOmniboxIcon( | 2297 gfx::Image ExtensionService::GetOmniboxIcon( |
2287 const std::string& extension_id) { | 2298 const std::string& extension_id) { |
2288 return gfx::Image(omnibox_icon_manager_.GetIcon(extension_id)); | 2299 return gfx::Image(omnibox_icon_manager_.GetIcon(extension_id)); |
2289 } | 2300 } |
2290 | 2301 |
2291 gfx::Image ExtensionService::GetOmniboxPopupIcon( | 2302 gfx::Image ExtensionService::GetOmniboxPopupIcon( |
2292 const std::string& extension_id) { | 2303 const std::string& extension_id) { |
2293 return gfx::Image(omnibox_popup_icon_manager_.GetIcon(extension_id)); | 2304 return gfx::Image(omnibox_popup_icon_manager_.GetIcon(extension_id)); |
2294 } | 2305 } |
2295 | 2306 |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2666 extension_host->extension(), | 2677 extension_host->extension(), |
2667 NULL, FilePath()); | 2678 NULL, FilePath()); |
2668 #endif | 2679 #endif |
2669 } | 2680 } |
2670 | 2681 |
2671 void ExtensionService::InspectExtensionHost( | 2682 void ExtensionService::InspectExtensionHost( |
2672 extensions::ExtensionHost* host) { | 2683 extensions::ExtensionHost* host) { |
2673 if (host) | 2684 if (host) |
2674 DevToolsWindow::OpenDevToolsWindow(host->render_view_host()); | 2685 DevToolsWindow::OpenDevToolsWindow(host->render_view_host()); |
2675 } | 2686 } |
OLD | NEW |