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.h" | 5 #include "chrome/common/extensions/extension.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 3213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3224 return runtime_data_.GetActivePermissions()->effective_hosts(); | 3224 return runtime_data_.GetActivePermissions()->effective_hosts(); |
3225 } | 3225 } |
3226 | 3226 |
3227 bool Extension::HasHostPermission(const GURL& url) const { | 3227 bool Extension::HasHostPermission(const GURL& url) const { |
3228 if (url.SchemeIs(chrome::kChromeUIScheme) && | 3228 if (url.SchemeIs(chrome::kChromeUIScheme) && |
3229 url.host() != chrome::kChromeUIFaviconHost && | 3229 url.host() != chrome::kChromeUIFaviconHost && |
3230 url.host() != chrome::kChromeUIThumbnailHost && | 3230 url.host() != chrome::kChromeUIThumbnailHost && |
3231 location() != Extension::COMPONENT) { | 3231 location() != Extension::COMPONENT) { |
3232 return false; | 3232 return false; |
3233 } | 3233 } |
3234 if (url.SchemeIs(chrome::kExtensionScheme) && | |
Aaron Boodman
2012/05/09 05:32:38
I think you can replace this entire new hunk with:
Aaron Boodman
2012/05/09 18:28:44
If this check were not here, are there multiple pl
benjhayden
2012/05/09 21:36:42
download() is the only function that will accept a
| |
3235 url.host() == id()) { | |
3236 return true; | |
3237 } | |
3238 if (url.inner_url() != NULL && | |
3239 url.inner_url()->is_valid() && | |
3240 url.SchemeIsFileSystem() && | |
3241 url.inner_url()->SchemeIs(chrome::kExtensionScheme) && | |
3242 url.inner_url()->host() == id()) { | |
3243 return true; | |
3244 } | |
3234 | 3245 |
3235 base::AutoLock auto_lock(runtime_data_lock_); | 3246 base::AutoLock auto_lock(runtime_data_lock_); |
3236 return runtime_data_.GetActivePermissions()-> | 3247 return runtime_data_.GetActivePermissions()-> |
3237 HasExplicitAccessToOrigin(url); | 3248 HasExplicitAccessToOrigin(url); |
3238 } | 3249 } |
3239 | 3250 |
3240 bool Extension::HasEffectiveAccessToAllHosts() const { | 3251 bool Extension::HasEffectiveAccessToAllHosts() const { |
3241 base::AutoLock auto_lock(runtime_data_lock_); | 3252 base::AutoLock auto_lock(runtime_data_lock_); |
3242 return runtime_data_.GetActivePermissions()->HasEffectiveAccessToAllHosts(); | 3253 return runtime_data_.GetActivePermissions()->HasEffectiveAccessToAllHosts(); |
3243 } | 3254 } |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3544 already_disabled(false), | 3555 already_disabled(false), |
3545 extension(extension) {} | 3556 extension(extension) {} |
3546 | 3557 |
3547 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 3558 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
3548 const Extension* extension, | 3559 const Extension* extension, |
3549 const ExtensionPermissionSet* permissions, | 3560 const ExtensionPermissionSet* permissions, |
3550 Reason reason) | 3561 Reason reason) |
3551 : reason(reason), | 3562 : reason(reason), |
3552 extension(extension), | 3563 extension(extension), |
3553 permissions(permissions) {} | 3564 permissions(permissions) {} |
OLD | NEW |