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 2169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2180 for (size_t i = 0; i < disabled_extensions_.size(); ++i) { | 2180 for (size_t i = 0; i < disabled_extensions_.size(); ++i) { |
2181 if (disabled_extensions_[i]->web_extent().MatchesURL(url)) | 2181 if (disabled_extensions_[i]->web_extent().MatchesURL(url)) |
2182 return disabled_extensions_[i]; | 2182 return disabled_extensions_[i]; |
2183 } | 2183 } |
2184 return NULL; | 2184 return NULL; |
2185 } | 2185 } |
2186 | 2186 |
2187 bool ExtensionService::ExtensionBindingsAllowed(const GURL& url) { | 2187 bool ExtensionService::ExtensionBindingsAllowed(const GURL& url) { |
2188 // Allow bindings for all packaged extensions. | 2188 // Allow bindings for all packaged extensions. |
2189 // Note that GetExtensionByURL may return an Extension for hosted apps | 2189 // Note that GetExtensionByURL may return an Extension for hosted apps |
2190 // if the URL came from GetEffectiveURL. | 2190 // (excluding bookmark apps) if the URL came from GetEffectiveURL. |
Aaron Boodman
2011/11/18 18:19:52
I don't think the last part of this comment is nec
Charlie Reis
2011/11/18 19:45:42
I think it's useful to have that comment, since it
| |
2191 const Extension* extension = GetExtensionByURL(url); | 2191 const Extension* extension = GetExtensionByURL(url); |
2192 if (extension && extension->GetType() != Extension::TYPE_HOSTED_APP) | 2192 if (extension && extension->GetType() != Extension::TYPE_HOSTED_APP) |
2193 return true; | 2193 return true; |
2194 | 2194 |
2195 // Allow bindings for all component, hosted apps. | 2195 // Allow bindings for all component, hosted apps. |
2196 if (!extension) | 2196 if (!extension) |
2197 extension = GetExtensionByWebExtent(url); | 2197 extension = GetExtensionByWebExtent(url); |
2198 return (extension && extension->location() == Extension::COMPONENT); | 2198 return (extension && extension->location() == Extension::COMPONENT); |
2199 } | 2199 } |
2200 | 2200 |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2502 | 2502 |
2503 ExtensionService::NaClModuleInfoList::iterator | 2503 ExtensionService::NaClModuleInfoList::iterator |
2504 ExtensionService::FindNaClModule(const GURL& url) { | 2504 ExtensionService::FindNaClModule(const GURL& url) { |
2505 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); | 2505 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); |
2506 iter != nacl_module_list_.end(); ++iter) { | 2506 iter != nacl_module_list_.end(); ++iter) { |
2507 if (iter->url == url) | 2507 if (iter->url == url) |
2508 return iter; | 2508 return iter; |
2509 } | 2509 } |
2510 return nacl_module_list_.end(); | 2510 return nacl_module_list_.end(); |
2511 } | 2511 } |
OLD | NEW |