| 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_API_PERMISSION_H_ | 5 #ifndef EXTENSIONS_COMMON_PERMISSIONS_API_PERMISSION_H_ |
| 6 #define EXTENSIONS_COMMON_PERMISSIONS_API_PERMISSION_H_ | 6 #define EXTENSIONS_COMMON_PERMISSIONS_API_PERMISSION_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 197 |
| 198 // Returns true if the given permission is allowed. | 198 // Returns true if the given permission is allowed. |
| 199 virtual bool Check(const CheckParam* param) const = 0; | 199 virtual bool Check(const CheckParam* param) const = 0; |
| 200 | 200 |
| 201 // Returns true if |rhs| is a subset of this. | 201 // Returns true if |rhs| is a subset of this. |
| 202 virtual bool Contains(const APIPermission* rhs) const = 0; | 202 virtual bool Contains(const APIPermission* rhs) const = 0; |
| 203 | 203 |
| 204 // Returns true if |rhs| is equal to this. | 204 // Returns true if |rhs| is equal to this. |
| 205 virtual bool Equal(const APIPermission* rhs) const = 0; | 205 virtual bool Equal(const APIPermission* rhs) const = 0; |
| 206 | 206 |
| 207 // Parses the APIPermission from |value|. Returns false if error happens. | 207 // Parses the APIPermission from |value|. Returns false if an error happens |
| 208 virtual bool FromValue(const base::Value* value) = 0; | 208 // and optionally set |error| if |error| is not NULL. |
| 209 virtual bool FromValue(const base::Value* value, std::string* error) = 0; |
| 209 | 210 |
| 210 // Stores this into a new created |value|. | 211 // Stores this into a new created |value|. |
| 211 virtual scoped_ptr<base::Value> ToValue() const = 0; | 212 virtual scoped_ptr<base::Value> ToValue() const = 0; |
| 212 | 213 |
| 213 // Clones this. | 214 // Clones this. |
| 214 virtual APIPermission* Clone() const = 0; | 215 virtual APIPermission* Clone() const = 0; |
| 215 | 216 |
| 216 // Returns a new API permission which equals this - |rhs|. | 217 // Returns a new API permission which equals this - |rhs|. |
| 217 virtual APIPermission* Diff(const APIPermission* rhs) const = 0; | 218 virtual APIPermission* Diff(const APIPermission* rhs) const = 0; |
| 218 | 219 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 const char* const name_; | 332 const char* const name_; |
| 332 const int flags_; | 333 const int flags_; |
| 333 const int l10n_message_id_; | 334 const int l10n_message_id_; |
| 334 const PermissionMessage::ID message_id_; | 335 const PermissionMessage::ID message_id_; |
| 335 const APIPermissionConstructor api_permission_constructor_; | 336 const APIPermissionConstructor api_permission_constructor_; |
| 336 }; | 337 }; |
| 337 | 338 |
| 338 } // namespace extensions | 339 } // namespace extensions |
| 339 | 340 |
| 340 #endif // EXTENSIONS_COMMON_PERMISSIONS_API_PERMISSION_H_ | 341 #endif // EXTENSIONS_COMMON_PERMISSIONS_API_PERMISSION_H_ |
| OLD | NEW |