| 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_COMMON_EXTENSIONS_PERMISSIONS_API_PERMISSION_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_PERMISSIONS_API_PERMISSION_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_PERMISSIONS_API_PERMISSION_H_ | 6 #define CHROME_COMMON_EXTENSIONS_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 28 matching lines...) Expand all Loading... |
| 39 // Real permissions. | 39 // Real permissions. |
| 40 kActiveTab, | 40 kActiveTab, |
| 41 kAlarms, | 41 kAlarms, |
| 42 kAppCurrentWindowInternal, | 42 kAppCurrentWindowInternal, |
| 43 kAppNotifications, | 43 kAppNotifications, |
| 44 kAppRuntime, | 44 kAppRuntime, |
| 45 kAppWindow, | 45 kAppWindow, |
| 46 kAudioCapture, | 46 kAudioCapture, |
| 47 kBackground, | 47 kBackground, |
| 48 kBluetooth, | 48 kBluetooth, |
| 49 kBluetoothDevice, | |
| 50 kBookmark, | 49 kBookmark, |
| 51 kBookmarkManagerPrivate, | 50 kBookmarkManagerPrivate, |
| 52 kBrowsingData, | 51 kBrowsingData, |
| 53 kChromeosInfoPrivate, | 52 kChromeosInfoPrivate, |
| 54 kClipboardRead, | 53 kClipboardRead, |
| 55 kClipboardWrite, | 54 kClipboardWrite, |
| 56 kCloudPrintPrivate, | 55 kCloudPrintPrivate, |
| 57 kContentSettings, | 56 kContentSettings, |
| 58 kContextMenus, | 57 kContextMenus, |
| 59 kCookie, | 58 kCookie, |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 ID id() const; | 126 ID id() const; |
| 128 | 127 |
| 129 // Returns the name of this permission. | 128 // Returns the name of this permission. |
| 130 const char* name() const; | 129 const char* name() const; |
| 131 | 130 |
| 132 // Returns the APIPermission of this permission. | 131 // Returns the APIPermission of this permission. |
| 133 const APIPermissionInfo* info() const { | 132 const APIPermissionInfo* info() const { |
| 134 return info_; | 133 return info_; |
| 135 } | 134 } |
| 136 | 135 |
| 137 // Returns a string representation of this permissions. The default string | |
| 138 // representation is the name of the permission. | |
| 139 virtual std::string ToString() const; | |
| 140 | |
| 141 // Returns true if this permission cannot be found in the manifest. | |
| 142 virtual bool ManifestEntryForbidden() const; | |
| 143 | |
| 144 // Returns true if this permission has any PermissionMessages. | 136 // Returns true if this permission has any PermissionMessages. |
| 145 virtual bool HasMessages() const = 0; | 137 virtual bool HasMessages() const = 0; |
| 146 | 138 |
| 147 // Returns the localized permission messages of this permission. | 139 // Returns the localized permission messages of this permission. |
| 148 virtual PermissionMessages GetMessages() const = 0; | 140 virtual PermissionMessages GetMessages() const = 0; |
| 149 | 141 |
| 150 // Returns true if the given permission is allowed. | 142 // Returns true if the given permission is allowed. |
| 151 virtual bool Check(const CheckParam* param) const = 0; | 143 virtual bool Check(const CheckParam* param) const = 0; |
| 152 | 144 |
| 153 // Returns true if |rhs| is a subset of this. | 145 // Returns true if |rhs| is a subset of this. |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 const char* const name_; | 267 const char* const name_; |
| 276 const int flags_; | 268 const int flags_; |
| 277 const int l10n_message_id_; | 269 const int l10n_message_id_; |
| 278 const PermissionMessage::ID message_id_; | 270 const PermissionMessage::ID message_id_; |
| 279 const APIPermissionConstructor api_permission_constructor_; | 271 const APIPermissionConstructor api_permission_constructor_; |
| 280 }; | 272 }; |
| 281 | 273 |
| 282 } // namespace extensions | 274 } // namespace extensions |
| 283 | 275 |
| 284 #endif // CHROME_COMMON_EXTENSIONS_PERMISSIONS_API_PERMISSION_H_ | 276 #endif // CHROME_COMMON_EXTENSIONS_PERMISSIONS_API_PERMISSION_H_ |
| OLD | NEW |