OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 2178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2189 for (size_t i = 0; i < disabled_extensions_.size(); ++i) { | 2189 for (size_t i = 0; i < disabled_extensions_.size(); ++i) { |
2190 if (disabled_extensions_[i]->web_extent().MatchesURL(url)) | 2190 if (disabled_extensions_[i]->web_extent().MatchesURL(url)) |
2191 return disabled_extensions_[i]; | 2191 return disabled_extensions_[i]; |
2192 } | 2192 } |
2193 return NULL; | 2193 return NULL; |
2194 } | 2194 } |
2195 | 2195 |
2196 bool ExtensionService::ExtensionBindingsAllowed(const GURL& url) { | 2196 bool ExtensionService::ExtensionBindingsAllowed(const GURL& url) { |
2197 // Allow bindings for all packaged extensions. | 2197 // Allow bindings for all packaged extensions. |
2198 // Note that GetExtensionByURL may return an Extension for hosted apps | 2198 // Note that GetExtensionByURL may return an Extension for hosted apps |
2199 // if the URL came from GetEffectiveURL. | 2199 // (excluding bookmark apps) if the URL came from GetEffectiveURL. |
2200 const Extension* extension = GetExtensionByURL(url); | 2200 const Extension* extension = GetExtensionByURL(url); |
2201 if (extension && extension->GetType() != Extension::TYPE_HOSTED_APP) | 2201 if (extension && extension->GetType() != Extension::TYPE_HOSTED_APP) |
2202 return true; | 2202 return true; |
2203 | 2203 |
2204 // Allow bindings for all component, hosted apps. | 2204 // Allow bindings for all component, hosted apps. |
2205 if (!extension) | 2205 if (!extension) |
2206 extension = GetExtensionByWebExtent(url); | 2206 extension = GetExtensionByWebExtent(url); |
2207 return (extension && extension->location() == Extension::COMPONENT); | 2207 return (extension && extension->location() == Extension::COMPONENT); |
2208 } | 2208 } |
2209 | 2209 |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2511 | 2511 |
2512 ExtensionService::NaClModuleInfoList::iterator | 2512 ExtensionService::NaClModuleInfoList::iterator |
2513 ExtensionService::FindNaClModule(const GURL& url) { | 2513 ExtensionService::FindNaClModule(const GURL& url) { |
2514 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); | 2514 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); |
2515 iter != nacl_module_list_.end(); ++iter) { | 2515 iter != nacl_module_list_.end(); ++iter) { |
2516 if (iter->url == url) | 2516 if (iter->url == url) |
2517 return iter; | 2517 return iter; |
2518 } | 2518 } |
2519 return nacl_module_list_.end(); | 2519 return nacl_module_list_.end(); |
2520 } | 2520 } |
OLD | NEW |