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 2277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2288 } | 2288 } |
2289 | 2289 |
2290 bool ExtensionService::ExtensionBindingsAllowed(const GURL& url) { | 2290 bool ExtensionService::ExtensionBindingsAllowed(const GURL& url) { |
2291 // Allow bindings for all packaged extensions and component hosted apps. | 2291 // Allow bindings for all packaged extensions and component hosted apps. |
2292 const Extension* extension = extensions_.GetExtensionOrAppByURL( | 2292 const Extension* extension = extensions_.GetExtensionOrAppByURL( |
2293 ExtensionURLInfo(url)); | 2293 ExtensionURLInfo(url)); |
2294 return extension && (!extension->is_hosted_app() || | 2294 return extension && (!extension->is_hosted_app() || |
2295 extension->location() == Extension::COMPONENT); | 2295 extension->location() == Extension::COMPONENT); |
2296 } | 2296 } |
2297 | 2297 |
| 2298 bool ExtensionService::ShouldBlockUrlInBrowserTab(GURL* url) { |
| 2299 const Extension* extension = extensions_.GetExtensionOrAppByURL( |
| 2300 ExtensionURLInfo(*url)); |
| 2301 if (extension && extension->is_platform_app()) { |
| 2302 *url = GURL(chrome::kExtensionInvalidRequestURL); |
| 2303 return true; |
| 2304 } |
| 2305 |
| 2306 return false; |
| 2307 } |
| 2308 |
2298 gfx::Image ExtensionService::GetOmniboxIcon( | 2309 gfx::Image ExtensionService::GetOmniboxIcon( |
2299 const std::string& extension_id) { | 2310 const std::string& extension_id) { |
2300 return gfx::Image(omnibox_icon_manager_.GetIcon(extension_id)); | 2311 return gfx::Image(omnibox_icon_manager_.GetIcon(extension_id)); |
2301 } | 2312 } |
2302 | 2313 |
2303 gfx::Image ExtensionService::GetOmniboxPopupIcon( | 2314 gfx::Image ExtensionService::GetOmniboxPopupIcon( |
2304 const std::string& extension_id) { | 2315 const std::string& extension_id) { |
2305 return gfx::Image(omnibox_popup_icon_manager_.GetIcon(extension_id)); | 2316 return gfx::Image(omnibox_popup_icon_manager_.GetIcon(extension_id)); |
2306 } | 2317 } |
2307 | 2318 |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2676 extension_host->extension(), | 2687 extension_host->extension(), |
2677 NULL, FilePath()); | 2688 NULL, FilePath()); |
2678 #endif | 2689 #endif |
2679 } | 2690 } |
2680 | 2691 |
2681 void ExtensionService::InspectExtensionHost( | 2692 void ExtensionService::InspectExtensionHost( |
2682 extensions::ExtensionHost* host) { | 2693 extensions::ExtensionHost* host) { |
2683 if (host) | 2694 if (host) |
2684 DevToolsWindow::OpenDevToolsWindow(host->render_view_host()); | 2695 DevToolsWindow::OpenDevToolsWindow(host->render_view_host()); |
2685 } | 2696 } |
OLD | NEW |