Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Side by Side Diff: chrome/common/extensions/extension_set.cc

Issue 12093036: Move Extension Location and Type enums to Manifest, and move InstallWarning to its own file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_messages.cc ('k') | chrome/common/extensions/extension_set_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698