Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Side by Side Diff: extensions/common/permissions/api_permission.h

Issue 141743005: Extensions: Make it possible for permission parsing code to return a detailed error message. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « extensions/common/manifest_constants.cc ('k') | extensions/common/permissions/api_permission.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698