| OLD | NEW |
| 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 "chrome/common/extensions/extension.h" | 5 #include "chrome/common/extensions/extension.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 // know about aliases. | 446 // know about aliases. |
| 447 | 447 |
| 448 std::vector<std::string> host_data; | 448 std::vector<std::string> host_data; |
| 449 if (!APIPermissionSet::ParseFromJSON(permissions, api_permissions, | 449 if (!APIPermissionSet::ParseFromJSON(permissions, api_permissions, |
| 450 error, &host_data)) | 450 error, &host_data)) |
| 451 return false; | 451 return false; |
| 452 | 452 |
| 453 // Verify feature availability of permissions. | 453 // Verify feature availability of permissions. |
| 454 std::vector<APIPermission::ID> to_remove; | 454 std::vector<APIPermission::ID> to_remove; |
| 455 FeatureProvider* permission_features = | 455 FeatureProvider* permission_features = |
| 456 BaseFeatureProvider::GetPermissionFeatures(); | 456 BaseFeatureProvider::LazyGetFeaturesByName("permission"); |
| 457 for (APIPermissionSet::const_iterator it = api_permissions->begin(); | 457 for (APIPermissionSet::const_iterator it = api_permissions->begin(); |
| 458 it != api_permissions->end(); ++it) { | 458 it != api_permissions->end(); ++it) { |
| 459 extensions::Feature* feature = | 459 extensions::Feature* feature = |
| 460 permission_features->GetFeature(it->name()); | 460 permission_features->GetFeature(it->name()); |
| 461 | 461 |
| 462 // The feature should exist since we just got an APIPermission | 462 // The feature should exist since we just got an APIPermission |
| 463 // for it. The two systems should be updated together whenever a | 463 // for it. The two systems should be updated together whenever a |
| 464 // permission is added. | 464 // permission is added. |
| 465 DCHECK(feature); | 465 DCHECK(feature); |
| 466 // http://crbug.com/176381 | 466 // http://crbug.com/176381 |
| (...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1795 | 1795 |
| 1796 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( | 1796 UpdatedExtensionPermissionsInfo::UpdatedExtensionPermissionsInfo( |
| 1797 const Extension* extension, | 1797 const Extension* extension, |
| 1798 const PermissionSet* permissions, | 1798 const PermissionSet* permissions, |
| 1799 Reason reason) | 1799 Reason reason) |
| 1800 : reason(reason), | 1800 : reason(reason), |
| 1801 extension(extension), | 1801 extension(extension), |
| 1802 permissions(permissions) {} | 1802 permissions(permissions) {} |
| 1803 | 1803 |
| 1804 } // namespace extensions | 1804 } // namespace extensions |
| OLD | NEW |