| 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 <ostream> | 7 #include <ostream> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "base/utf_string_conversions.h" | 23 #include "base/utf_string_conversions.h" |
| 24 #include "base/values.h" | 24 #include "base/values.h" |
| 25 #include "base/version.h" | 25 #include "base/version.h" |
| 26 #include "chrome/common/chrome_constants.h" | 26 #include "chrome/common/chrome_constants.h" |
| 27 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
| 28 #include "chrome/common/chrome_version_info.h" | 28 #include "chrome/common/chrome_version_info.h" |
| 29 #include "chrome/common/extensions/csp_validator.h" | 29 #include "chrome/common/extensions/csp_validator.h" |
| 30 #include "chrome/common/extensions/extension_manifest_constants.h" | 30 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 31 #include "chrome/common/extensions/extension_resource.h" | 31 #include "chrome/common/extensions/extension_resource.h" |
| 32 #include "chrome/common/extensions/feature_switch.h" | 32 #include "chrome/common/extensions/feature_switch.h" |
| 33 #include "chrome/common/extensions/features/base_feature_provider.h" |
| 33 #include "chrome/common/extensions/features/feature.h" | 34 #include "chrome/common/extensions/features/feature.h" |
| 34 #include "chrome/common/extensions/features/simple_feature_provider.h" | |
| 35 #include "chrome/common/extensions/file_browser_handler.h" | 35 #include "chrome/common/extensions/file_browser_handler.h" |
| 36 #include "chrome/common/extensions/manifest.h" | 36 #include "chrome/common/extensions/manifest.h" |
| 37 #include "chrome/common/extensions/manifest_handler.h" | 37 #include "chrome/common/extensions/manifest_handler.h" |
| 38 #include "chrome/common/extensions/permissions/permission_set.h" | 38 #include "chrome/common/extensions/permissions/permission_set.h" |
| 39 #include "chrome/common/extensions/permissions/permissions_info.h" | 39 #include "chrome/common/extensions/permissions/permissions_info.h" |
| 40 #include "chrome/common/extensions/user_script.h" | 40 #include "chrome/common/extensions/user_script.h" |
| 41 #include "chrome/common/url_constants.h" | 41 #include "chrome/common/url_constants.h" |
| 42 #include "crypto/sha2.h" | 42 #include "crypto/sha2.h" |
| 43 #include "extensions/common/constants.h" | 43 #include "extensions/common/constants.h" |
| 44 #include "extensions/common/error_utils.h" | 44 #include "extensions/common/error_utils.h" |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 // associated with them are available because the feature system does not | 750 // associated with them are available because the feature system does not |
| 751 // know about aliases. | 751 // know about aliases. |
| 752 | 752 |
| 753 std::vector<std::string> host_data; | 753 std::vector<std::string> host_data; |
| 754 if (!APIPermissionSet::ParseFromJSON(permissions, api_permissions, | 754 if (!APIPermissionSet::ParseFromJSON(permissions, api_permissions, |
| 755 error, &host_data)) | 755 error, &host_data)) |
| 756 return false; | 756 return false; |
| 757 | 757 |
| 758 // Verify feature availability of permissions. | 758 // Verify feature availability of permissions. |
| 759 std::vector<APIPermission::ID> to_remove; | 759 std::vector<APIPermission::ID> to_remove; |
| 760 SimpleFeatureProvider* permission_features = | 760 FeatureProvider* permission_features = |
| 761 SimpleFeatureProvider::GetPermissionFeatures(); | 761 BaseFeatureProvider::GetPermissionFeatures(); |
| 762 for (APIPermissionSet::const_iterator it = api_permissions->begin(); | 762 for (APIPermissionSet::const_iterator it = api_permissions->begin(); |
| 763 it != api_permissions->end(); ++it) { | 763 it != api_permissions->end(); ++it) { |
| 764 extensions::Feature* feature = | 764 extensions::Feature* feature = |
| 765 permission_features->GetFeature(it->name()); | 765 permission_features->GetFeature(it->name()); |
| 766 | 766 |
| 767 // The feature should exist since we just got an APIPermission | 767 // The feature should exist since we just got an APIPermission |
| 768 // for it. The two systems should be updated together whenever a | 768 // for it. The two systems should be updated together whenever a |
| 769 // permission is added. | 769 // permission is added. |
| 770 CHECK(feature); | 770 CHECK(feature); |
| 771 | 771 |
| (...skipping 3448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4220 | 4220 |
| 4221 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 4221 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
| 4222 const Extension* extension, | 4222 const Extension* extension, |
| 4223 const PermissionSet* permissions, | 4223 const PermissionSet* permissions, |
| 4224 Reason reason) | 4224 Reason reason) |
| 4225 : reason(reason), | 4225 : reason(reason), |
| 4226 extension(extension), | 4226 extension(extension), |
| 4227 permissions(permissions) {} | 4227 permissions(permissions) {} |
| 4228 | 4228 |
| 4229 } // namespace extensions | 4229 } // namespace extensions |
| OLD | NEW |