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

Side by Side Diff: extensions/common/permissions/permissions_data.cc

Issue 293943002: Clean up TestFeaturesNativeHandler to use the ExtensionsClient's JSON feature sources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 months 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
« no previous file with comments | « extensions/common/manifest.cc ('k') | extensions/renderer/api_definitions_natives.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "extensions/common/permissions/permissions_data.h" 5 #include "extensions/common/permissions/permissions_data.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 std::vector<std::string> host_data; 113 std::vector<std::string> host_data;
114 if (!APIPermissionSet::ParseFromJSON( 114 if (!APIPermissionSet::ParseFromJSON(
115 permissions, APIPermissionSet::kDisallowInternalPermissions, 115 permissions, APIPermissionSet::kDisallowInternalPermissions,
116 api_permissions, error, &host_data)) { 116 api_permissions, error, &host_data)) {
117 return false; 117 return false;
118 } 118 }
119 119
120 // Verify feature availability of permissions. 120 // Verify feature availability of permissions.
121 std::vector<APIPermission::ID> to_remove; 121 std::vector<APIPermission::ID> to_remove;
122 FeatureProvider* permission_features = 122 const FeatureProvider* permission_features =
123 FeatureProvider::GetPermissionFeatures(); 123 FeatureProvider::GetPermissionFeatures();
124 for (APIPermissionSet::const_iterator iter = api_permissions->begin(); 124 for (APIPermissionSet::const_iterator iter = api_permissions->begin();
125 iter != api_permissions->end(); ++iter) { 125 iter != api_permissions->end(); ++iter) {
126 Feature* feature = permission_features->GetFeature(iter->name()); 126 Feature* feature = permission_features->GetFeature(iter->name());
127 127
128 // The feature should exist since we just got an APIPermission for it. The 128 // The feature should exist since we just got an APIPermission for it. The
129 // two systems should be updated together whenever a permission is added. 129 // two systems should be updated together whenever a permission is added.
130 DCHECK(feature) << "Could not find feature for " << iter->name(); 130 DCHECK(feature) << "Could not find feature for " << iter->name();
131 // http://crbug.com/176381 131 // http://crbug.com/176381
132 if (!feature) { 132 if (!feature) {
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 initial_optional_permissions_->api_permissions, 617 initial_optional_permissions_->api_permissions,
618 initial_optional_permissions_->manifest_permissions, 618 initial_optional_permissions_->manifest_permissions,
619 initial_optional_permissions_->host_permissions, 619 initial_optional_permissions_->host_permissions,
620 URLPatternSet()); 620 URLPatternSet());
621 621
622 initial_required_permissions_.reset(); 622 initial_required_permissions_.reset();
623 initial_optional_permissions_.reset(); 623 initial_optional_permissions_.reset();
624 } 624 }
625 625
626 } // namespace extensions 626 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/manifest.cc ('k') | extensions/renderer/api_definitions_natives.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698