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

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

Issue 11316164: Implement ComplexFeature to support permission features with multiple rules. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments, cleanup Created 8 years 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.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 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 SimpleFeatureProvider::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);
(...skipping 3449 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698