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 #ifndef EXTENSIONS_COMMON_PERMISSIONS_MANIFEST_PERMISSION_H_ | 5 #ifndef EXTENSIONS_COMMON_PERMISSIONS_MANIFEST_PERMISSION_H_ |
6 #define EXTENSIONS_COMMON_PERMISSIONS_MANIFEST_PERMISSION_H_ | 6 #define EXTENSIONS_COMMON_PERMISSIONS_MANIFEST_PERMISSION_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <string> | 9 #include <string> |
9 | 10 |
10 #include "base/macros.h" | 11 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "base/pickle.h" | 12 #include "base/pickle.h" |
13 #include "extensions/common/permissions/api_permission_set.h" | 13 #include "extensions/common/permissions/api_permission_set.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class PickleIterator; | 16 class PickleIterator; |
17 class Value; | 17 class Value; |
18 } | 18 } |
19 | 19 |
20 namespace IPC { | 20 namespace IPC { |
21 class Message; | 21 class Message; |
(...skipping 16 matching lines...) Expand all Loading... |
38 | 38 |
39 // The set of permissions this manifest entry has. These permissions are used | 39 // The set of permissions this manifest entry has. These permissions are used |
40 // by PermissionMessageProvider to generate meaningful permission messages | 40 // by PermissionMessageProvider to generate meaningful permission messages |
41 // for the app. | 41 // for the app. |
42 virtual PermissionIDSet GetPermissions() const = 0; | 42 virtual PermissionIDSet GetPermissions() const = 0; |
43 | 43 |
44 // Parses the ManifestPermission from |value|. Returns false if error happens. | 44 // Parses the ManifestPermission from |value|. Returns false if error happens. |
45 virtual bool FromValue(const base::Value* value) = 0; | 45 virtual bool FromValue(const base::Value* value) = 0; |
46 | 46 |
47 // Stores this into a new created Value. | 47 // Stores this into a new created Value. |
48 virtual scoped_ptr<base::Value> ToValue() const = 0; | 48 virtual std::unique_ptr<base::Value> ToValue() const = 0; |
49 | 49 |
50 // Clones this. | 50 // Clones this. |
51 ManifestPermission* Clone() const; | 51 ManifestPermission* Clone() const; |
52 | 52 |
53 // Returns a new manifest permission which equals this - |rhs|. | 53 // Returns a new manifest permission which equals this - |rhs|. |
54 virtual ManifestPermission* Diff(const ManifestPermission* rhs) const = 0; | 54 virtual ManifestPermission* Diff(const ManifestPermission* rhs) const = 0; |
55 | 55 |
56 // Returns a new manifest permission which equals the union of this and |rhs|. | 56 // Returns a new manifest permission which equals the union of this and |rhs|. |
57 virtual ManifestPermission* Union(const ManifestPermission* rhs) const = 0; | 57 virtual ManifestPermission* Union(const ManifestPermission* rhs) const = 0; |
58 | 58 |
(...skipping 18 matching lines...) Expand all Loading... |
77 // Logs this permission. | 77 // Logs this permission. |
78 void Log(std::string* log) const; | 78 void Log(std::string* log) const; |
79 | 79 |
80 private: | 80 private: |
81 DISALLOW_COPY_AND_ASSIGN(ManifestPermission); | 81 DISALLOW_COPY_AND_ASSIGN(ManifestPermission); |
82 }; | 82 }; |
83 | 83 |
84 } // namespace extensions | 84 } // namespace extensions |
85 | 85 |
86 #endif // EXTENSIONS_COMMON_PERMISSIONS_MANIFEST_PERMISSION_H_ | 86 #endif // EXTENSIONS_COMMON_PERMISSIONS_MANIFEST_PERMISSION_H_ |
OLD | NEW |