| 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, |
| 49 kBookmark, | 50 kBookmark, |
| 50 kBookmarkManagerPrivate, | 51 kBookmarkManagerPrivate, |
| 51 kBrowsingData, | 52 kBrowsingData, |
| 52 kChromeosInfoPrivate, | 53 kChromeosInfoPrivate, |
| 53 kClipboardRead, | 54 kClipboardRead, |
| 54 kClipboardWrite, | 55 kClipboardWrite, |
| 55 kCloudPrintPrivate, | 56 kCloudPrintPrivate, |
| 56 kContentSettings, | 57 kContentSettings, |
| 57 kContextMenus, | 58 kContextMenus, |
| 58 kCookie, | 59 kCookie, |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 ID id() const; | 126 ID id() const; |
| 126 | 127 |
| 127 // Returns the name of this permission. | 128 // Returns the name of this permission. |
| 128 const char* name() const; | 129 const char* name() const; |
| 129 | 130 |
| 130 // Returns the APIPermission of this permission. | 131 // Returns the APIPermission of this permission. |
| 131 const APIPermissionInfo* info() const { | 132 const APIPermissionInfo* info() const { |
| 132 return info_; | 133 return info_; |
| 133 } | 134 } |
| 134 | 135 |
| 136 // Returns a string representation of this permissions. The default string |
| 137 // representation is the name of the permission. |
| 138 virtual std::string ToString() const; |
| 139 |
| 140 // Returns true if this permission must be found in the manifest in order to |
| 141 // be issued. |
| 142 virtual bool ManifestEntryRequired() const; |
| 143 |
| 144 // Returns true if this permission cannot be found in the manifest. |
| 145 virtual bool ManifestEntryForbidden() const; |
| 146 |
| 135 // Returns true if this permission has any PermissionMessages. | 147 // Returns true if this permission has any PermissionMessages. |
| 136 virtual bool HasMessages() const = 0; | 148 virtual bool HasMessages() const = 0; |
| 137 | 149 |
| 138 // Returns the localized permission messages of this permission. | 150 // Returns the localized permission messages of this permission. |
| 139 virtual PermissionMessages GetMessages() const = 0; | 151 virtual PermissionMessages GetMessages() const = 0; |
| 140 | 152 |
| 141 // Returns true if the given permission is allowed. | 153 // Returns true if the given permission is allowed. |
| 142 virtual bool Check(const CheckParam* param) const = 0; | 154 virtual bool Check(const CheckParam* param) const = 0; |
| 143 | 155 |
| 144 // Returns true if |rhs| is a subset of this. | 156 // Returns true if |rhs| is a subset of this. |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 const char* const name_; | 278 const char* const name_; |
| 267 const int flags_; | 279 const int flags_; |
| 268 const int l10n_message_id_; | 280 const int l10n_message_id_; |
| 269 const PermissionMessage::ID message_id_; | 281 const PermissionMessage::ID message_id_; |
| 270 const APIPermissionConstructor api_permission_constructor_; | 282 const APIPermissionConstructor api_permission_constructor_; |
| 271 }; | 283 }; |
| 272 | 284 |
| 273 } // namespace extensions | 285 } // namespace extensions |
| 274 | 286 |
| 275 #endif // CHROME_COMMON_EXTENSIONS_PERMISSIONS_API_PERMISSION_H_ | 287 #endif // CHROME_COMMON_EXTENSIONS_PERMISSIONS_API_PERMISSION_H_ |
| OLD | NEW |