Chromium Code Reviews| 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/complex_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/permissions/permission_set.h" | 37 #include "chrome/common/extensions/permissions/permission_set.h" |
| 38 #include "chrome/common/extensions/permissions/permissions_info.h" | 38 #include "chrome/common/extensions/permissions/permissions_info.h" |
| 39 #include "chrome/common/extensions/user_script.h" | 39 #include "chrome/common/extensions/user_script.h" |
| 40 #include "chrome/common/url_constants.h" | 40 #include "chrome/common/url_constants.h" |
| 41 #include "crypto/sha2.h" | 41 #include "crypto/sha2.h" |
| 42 #include "extensions/common/constants.h" | 42 #include "extensions/common/constants.h" |
| 43 #include "extensions/common/error_utils.h" | 43 #include "extensions/common/error_utils.h" |
| 44 #include "extensions/common/url_pattern_set.h" | 44 #include "extensions/common/url_pattern_set.h" |
| (...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 728 // associated with them are available because the feature system does not | 728 // associated with them are available because the feature system does not |
| 729 // know about aliases. | 729 // know about aliases. |
| 730 | 730 |
| 731 std::vector<std::string> host_data; | 731 std::vector<std::string> host_data; |
| 732 if (!APIPermissionSet::ParseFromJSON(permissions, api_permissions, | 732 if (!APIPermissionSet::ParseFromJSON(permissions, api_permissions, |
| 733 error, &host_data)) | 733 error, &host_data)) |
| 734 return false; | 734 return false; |
| 735 | 735 |
| 736 // Verify feature availability of permissions. | 736 // Verify feature availability of permissions. |
| 737 std::vector<APIPermission::ID> to_remove; | 737 std::vector<APIPermission::ID> to_remove; |
| 738 SimpleFeatureProvider* permission_features = | 738 ComplexFeatureProvider* permission_features = |
|
not at google - send to devlin
2012/12/12 17:42:41
FeatureProvider on LHS
justinlin
2012/12/14 12:26:26
Done.
| |
| 739 SimpleFeatureProvider::GetPermissionFeatures(); | 739 ComplexFeatureProvider::GetPermissionFeatures(); |
| 740 for (APIPermissionSet::const_iterator it = api_permissions->begin(); | 740 for (APIPermissionSet::const_iterator it = api_permissions->begin(); |
| 741 it != api_permissions->end(); ++it) { | 741 it != api_permissions->end(); ++it) { |
| 742 extensions::Feature* feature = | 742 extensions::Feature* feature = |
| 743 permission_features->GetFeature(it->name()); | 743 permission_features->GetFeature(it->name()); |
| 744 | 744 |
| 745 // The feature should exist since we just got an APIPermission | 745 // The feature should exist since we just got an APIPermission |
| 746 // for it. The two systems should be updated together whenever a | 746 // for it. The two systems should be updated together whenever a |
| 747 // permission is added. | 747 // permission is added. |
| 748 CHECK(feature); | 748 CHECK(feature); |
| 749 | 749 |
| (...skipping 3424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4174 | 4174 |
| 4175 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 4175 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
| 4176 const Extension* extension, | 4176 const Extension* extension, |
| 4177 const PermissionSet* permissions, | 4177 const PermissionSet* permissions, |
| 4178 Reason reason) | 4178 Reason reason) |
| 4179 : reason(reason), | 4179 : reason(reason), |
| 4180 extension(extension), | 4180 extension(extension), |
| 4181 permissions(permissions) {} | 4181 permissions(permissions) {} |
| 4182 | 4182 |
| 4183 } // namespace extensions | 4183 } // namespace extensions |
| OLD | NEW |