| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_PERMISSIONS_PERMISSIONS_API_HELPERS_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_PERMISSIONS_PERMISSIONS_API_HELPERS_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_PERMISSIONS_PERMISSIONS_API_HELPERS_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_PERMISSIONS_PERMISSIONS_API_HELPERS_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 | 12 |
| 13 namespace base { | |
| 14 class DictionaryValue; | |
| 15 } | |
| 16 | |
| 17 namespace extensions { | 13 namespace extensions { |
| 18 | 14 |
| 19 class PermissionSet; | 15 class PermissionSet; |
| 20 | 16 |
| 21 namespace api { | 17 namespace api { |
| 22 namespace permissions { | 18 namespace permissions { |
| 23 struct Permissions; | 19 struct Permissions; |
| 24 } | 20 } |
| 25 } | 21 } |
| 26 | 22 |
| 27 namespace permissions_api_helpers { | 23 namespace permissions_api_helpers { |
| 28 | 24 |
| 29 // Converts the permission |set| to a permissions object. | 25 // Converts the permission |set| to a permissions object. |
| 30 std::unique_ptr<api::permissions::Permissions> PackPermissionSet( | 26 std::unique_ptr<api::permissions::Permissions> PackPermissionSet( |
| 31 const PermissionSet& set); | 27 const PermissionSet& set); |
| 32 | 28 |
| 33 // Creates a permission set from |permissions|. Returns NULL if the permissions | 29 // Creates a permission set from |permissions|. Returns NULL if the permissions |
| 34 // cannot be converted to a permission set, in which case |error| will be set. | 30 // cannot be converted to a permission set, in which case |error| will be set. |
| 35 std::unique_ptr<const PermissionSet> UnpackPermissionSet( | 31 std::unique_ptr<const PermissionSet> UnpackPermissionSet( |
| 36 const api::permissions::Permissions& permissions, | 32 const api::permissions::Permissions& permissions, |
| 37 bool allow_file_access, | 33 bool allow_file_access, |
| 38 std::string* error); | 34 std::string* error); |
| 39 | 35 |
| 40 } // namespace permissions_api_helpers | 36 } // namespace permissions_api_helpers |
| 41 } // namespace extensions | 37 } // namespace extensions |
| 42 | 38 |
| 43 #endif // CHROME_BROWSER_EXTENSIONS_API_PERMISSIONS_PERMISSIONS_API_HELPERS_H_ | 39 #endif // CHROME_BROWSER_EXTENSIONS_API_PERMISSIONS_PERMISSIONS_API_HELPERS_H_ |
| OLD | NEW |