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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 return (flags_ & kFlagMustBeOptional) != 0; | 260 return (flags_ & kFlagMustBeOptional) != 0; |
261 } | 261 } |
262 | 262 |
263 private: | 263 private: |
264 // Instances should only be constructed from within PermissionsInfo. | 264 // Instances should only be constructed from within PermissionsInfo. |
265 friend class PermissionsInfo; | 265 friend class PermissionsInfo; |
266 // Implementations of APIPermission will want to get the permission message, | 266 // Implementations of APIPermission will want to get the permission message, |
267 // but this class's implementation should be hidden from everyone else. | 267 // but this class's implementation should be hidden from everyone else. |
268 friend class APIPermission; | 268 friend class APIPermission; |
269 | 269 |
270 explicit APIPermissionInfo( | 270 APIPermissionInfo( |
271 APIPermission::ID id, | 271 APIPermission::ID id, |
272 const char* name, | 272 const char* name, |
273 int l10n_message_id, | 273 int l10n_message_id, |
274 PermissionMessage::ID message_id, | 274 PermissionMessage::ID message_id, |
275 int flags, | 275 int flags, |
276 APIPermissionConstructor api_permission_constructor); | 276 APIPermissionConstructor api_permission_constructor); |
277 | 277 |
278 // Register ALL the permissions! | 278 // Register ALL the permissions! |
279 static void RegisterAllPermissions(PermissionsInfo* info); | 279 static void RegisterAllPermissions(PermissionsInfo* info); |
280 | 280 |
281 // Returns the localized permission message associated with this api. | 281 // Returns the localized permission message associated with this api. |
282 // Use GetMessage_ to avoid name conflict with macro GetMessage on Windows. | 282 // Use GetMessage_ to avoid name conflict with macro GetMessage on Windows. |
283 PermissionMessage GetMessage_() const; | 283 PermissionMessage GetMessage_() const; |
284 | 284 |
285 const APIPermission::ID id_; | 285 const APIPermission::ID id_; |
286 const char* const name_; | 286 const char* const name_; |
287 const int flags_; | 287 const int flags_; |
288 const int l10n_message_id_; | 288 const int l10n_message_id_; |
289 const PermissionMessage::ID message_id_; | 289 const PermissionMessage::ID message_id_; |
290 const APIPermissionConstructor api_permission_constructor_; | 290 const APIPermissionConstructor api_permission_constructor_; |
291 }; | 291 }; |
292 | 292 |
293 } // namespace extensions | 293 } // namespace extensions |
294 | 294 |
295 #endif // CHROME_COMMON_EXTENSIONS_PERMISSIONS_API_PERMISSION_H_ | 295 #endif // CHROME_COMMON_EXTENSIONS_PERMISSIONS_API_PERMISSION_H_ |
OLD | NEW |