| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 3296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3307 extensions::SimpleFeatureProvider::GetPermissionFeatures(); | 3307 extensions::SimpleFeatureProvider::GetPermissionFeatures(); |
| 3308 scoped_ptr<extensions::Feature> feature( | 3308 scoped_ptr<extensions::Feature> feature( |
| 3309 permission_features->GetFeature(permission->name())); | 3309 permission_features->GetFeature(permission->name())); |
| 3310 | 3310 |
| 3311 // The feature should exist since we just got an ExtensionAPIPermission | 3311 // The feature should exist since we just got an ExtensionAPIPermission |
| 3312 // for it. The two systems should be updated together whenever a | 3312 // for it. The two systems should be updated together whenever a |
| 3313 // permission is added. | 3313 // permission is added. |
| 3314 CHECK(feature.get()); | 3314 CHECK(feature.get()); |
| 3315 | 3315 |
| 3316 extensions::Feature::Availability availability = | 3316 extensions::Feature::Availability availability = |
| 3317 feature->IsAvailableToManifest( | 3317 feature->IsAvailable(this); |
| 3318 id(), | |
| 3319 GetType(), | |
| 3320 extensions::Feature::ConvertLocation(location()), | |
| 3321 manifest_version()); | |
| 3322 if (availability != extensions::Feature::IS_AVAILABLE) { | 3318 if (availability != extensions::Feature::IS_AVAILABLE) { |
| 3323 // We special case hosted apps because some old versions of Chrome did | 3319 // We special case hosted apps because some old versions of Chrome did |
| 3324 // not return errors here and we ended up with extensions in the store | 3320 // not return errors here and we ended up with extensions in the store |
| 3325 // containing bad data: crbug.com/101993. | 3321 // containing bad data: crbug.com/101993. |
| 3326 if (availability != extensions::Feature::INVALID_TYPE || | 3322 if (availability != extensions::Feature::INVALID_TYPE || |
| 3327 !is_hosted_app()) { | 3323 !is_hosted_app()) { |
| 3328 *error = ASCIIToUTF16(feature->GetErrorMessage(availability)); | 3324 *error = ASCIIToUTF16(feature->GetErrorMessage(availability)); |
| 3329 return false; | 3325 return false; |
| 3330 } | 3326 } |
| 3331 } | 3327 } |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3705 already_disabled(false), | 3701 already_disabled(false), |
| 3706 extension(extension) {} | 3702 extension(extension) {} |
| 3707 | 3703 |
| 3708 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 3704 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
| 3709 const Extension* extension, | 3705 const Extension* extension, |
| 3710 const ExtensionPermissionSet* permissions, | 3706 const ExtensionPermissionSet* permissions, |
| 3711 Reason reason) | 3707 Reason reason) |
| 3712 : reason(reason), | 3708 : reason(reason), |
| 3713 extension(extension), | 3709 extension(extension), |
| 3714 permissions(permissions) {} | 3710 permissions(permissions) {} |
| OLD | NEW |