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

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

Issue 2236443003: extensions: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't add braces Created 4 years, 4 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
« no previous file with comments | « extensions/common/message_bundle.cc ('k') | extensions/common/permissions/permissions_info.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/api_permission_set.h" 5 #include "extensions/common/permissions/api_permission_set.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 subset.permissions_.insert(*it); 268 subset.permissions_.insert(*it);
269 ++it; 269 ++it;
270 } 270 }
271 return subset; 271 return subset;
272 } 272 }
273 273
274 PermissionIDSet PermissionIDSet::GetAllPermissionsWithIDs( 274 PermissionIDSet PermissionIDSet::GetAllPermissionsWithIDs(
275 const std::set<APIPermission::ID>& permission_ids) const { 275 const std::set<APIPermission::ID>& permission_ids) const {
276 PermissionIDSet subset; 276 PermissionIDSet subset;
277 for (const auto& permission : permissions_) { 277 for (const auto& permission : permissions_) {
278 if (ContainsKey(permission_ids, permission.id())) { 278 if (base::ContainsKey(permission_ids, permission.id())) {
279 subset.permissions_.insert(permission); 279 subset.permissions_.insert(permission);
280 } 280 }
281 } 281 }
282 return subset; 282 return subset;
283 } 283 }
284 284
285 bool PermissionIDSet::Includes(const PermissionIDSet& subset) const { 285 bool PermissionIDSet::Includes(const PermissionIDSet& subset) const {
286 return base::STLIncludes(permissions_, subset.permissions_); 286 return base::STLIncludes(permissions_, subset.permissions_);
287 } 287 }
288 288
(...skipping 14 matching lines...) Expand all
303 303
304 bool PermissionIDSet::empty() const { 304 bool PermissionIDSet::empty() const {
305 return permissions_.empty(); 305 return permissions_.empty();
306 } 306 }
307 307
308 PermissionIDSet::PermissionIDSet(const std::set<PermissionID>& permissions) 308 PermissionIDSet::PermissionIDSet(const std::set<PermissionID>& permissions)
309 : permissions_(permissions) { 309 : permissions_(permissions) {
310 } 310 }
311 311
312 } // namespace extensions 312 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/common/message_bundle.cc ('k') | extensions/common/permissions/permissions_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698