| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |