| 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/manifest_permission_set.h" | 5 #include "extensions/common/permissions/manifest_permission_set.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 using extensions::ManifestPermissionSet; | 21 using extensions::ManifestPermissionSet; |
| 22 using extensions::ManifestHandler; | 22 using extensions::ManifestHandler; |
| 23 namespace errors = extensions::manifest_errors; | 23 namespace errors = extensions::manifest_errors; |
| 24 | 24 |
| 25 bool CreateManifestPermission( | 25 bool CreateManifestPermission( |
| 26 const std::string& permission_name, | 26 const std::string& permission_name, |
| 27 const base::Value* permission_value, | 27 const base::Value* permission_value, |
| 28 ManifestPermissionSet* manifest_permissions, | 28 ManifestPermissionSet* manifest_permissions, |
| 29 base::string16* error, | 29 base::string16* error, |
| 30 std::vector<std::string>* unhandled_permissions) { | 30 std::vector<std::string>* unhandled_permissions) { |
| 31 | 31 std::unique_ptr<ManifestPermission> permission( |
| 32 scoped_ptr<ManifestPermission> permission( | |
| 33 ManifestHandler::CreatePermission(permission_name)); | 32 ManifestHandler::CreatePermission(permission_name)); |
| 34 | 33 |
| 35 if (!permission) { | 34 if (!permission) { |
| 36 if (unhandled_permissions) | 35 if (unhandled_permissions) |
| 37 unhandled_permissions->push_back(permission_name); | 36 unhandled_permissions->push_back(permission_name); |
| 38 else | 37 else |
| 39 LOG(WARNING) << "Unknown permission[" << permission_name << "]."; | 38 LOG(WARNING) << "Unknown permission[" << permission_name << "]."; |
| 40 return true; | 39 return true; |
| 41 } | 40 } |
| 42 | 41 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 85 |
| 87 if (!CreateManifestPermission(permission_name, permission_value, | 86 if (!CreateManifestPermission(permission_name, permission_value, |
| 88 manifest_permissions, error, | 87 manifest_permissions, error, |
| 89 unhandled_permissions)) | 88 unhandled_permissions)) |
| 90 return false; | 89 return false; |
| 91 } | 90 } |
| 92 return true; | 91 return true; |
| 93 } | 92 } |
| 94 | 93 |
| 95 } // namespace extensions | 94 } // namespace extensions |
| OLD | NEW |