| 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/common/extensions/extension_set.h" | 5 #include "chrome/common/extensions/extension_set.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/common/extensions/extension.h" | 8 #include "chrome/common/extensions/extension.h" |
| 9 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
| 10 #include "extensions/common/constants.h" | 10 #include "extensions/common/constants.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 bool ExtensionSet::ExtensionBindingsAllowed( | 149 bool ExtensionSet::ExtensionBindingsAllowed( |
| 150 const ExtensionURLInfo& info) const { | 150 const ExtensionURLInfo& info) const { |
| 151 if (info.origin().isUnique() || IsSandboxedPage(info)) | 151 if (info.origin().isUnique() || IsSandboxedPage(info)) |
| 152 return false; | 152 return false; |
| 153 | 153 |
| 154 if (info.url().SchemeIs(extensions::kExtensionScheme)) | 154 if (info.url().SchemeIs(extensions::kExtensionScheme)) |
| 155 return true; | 155 return true; |
| 156 | 156 |
| 157 ExtensionMap::const_iterator i = extensions_.begin(); | 157 ExtensionMap::const_iterator i = extensions_.begin(); |
| 158 for (; i != extensions_.end(); ++i) { | 158 for (; i != extensions_.end(); ++i) { |
| 159 if (i->second->location() == Extension::COMPONENT && | 159 if (i->second->location() == extensions::Manifest::COMPONENT && |
| 160 i->second->web_extent().MatchesURL(info.url())) | 160 i->second->web_extent().MatchesURL(info.url())) |
| 161 return true; | 161 return true; |
| 162 } | 162 } |
| 163 | 163 |
| 164 return false; | 164 return false; |
| 165 } | 165 } |
| 166 | 166 |
| 167 bool ExtensionSet::IsSandboxedPage(const ExtensionURLInfo& info) const { | 167 bool ExtensionSet::IsSandboxedPage(const ExtensionURLInfo& info) const { |
| 168 if (info.url().SchemeIs(extensions::kExtensionScheme)) { | 168 if (info.url().SchemeIs(extensions::kExtensionScheme)) { |
| 169 const Extension* extension = GetByID(info.url().host()); | 169 const Extension* extension = GetByID(info.url().host()); |
| 170 if (extension) { | 170 if (extension) { |
| 171 return extension->IsSandboxedPage(info.url().path()); | 171 return extension->IsSandboxedPage(info.url().path()); |
| 172 } | 172 } |
| 173 } | 173 } |
| 174 return false; | 174 return false; |
| 175 } | 175 } |
| OLD | NEW |