| 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_PERMISSION_SET_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_PERMISSIONS_PERMISSION_SET_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_PERMISSIONS_PERMISSION_SET_H_ | 6 #define CHROME_COMMON_EXTENSIONS_PERMISSIONS_PERMISSION_SET_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 std::set<std::string> GetAPIsAsStrings() const; | 71 std::set<std::string> GetAPIsAsStrings() const; |
| 72 | 72 |
| 73 // Returns whether this namespace has any functions which the extension has | 73 // Returns whether this namespace has any functions which the extension has |
| 74 // permission to use. For example, even though the extension may not have | 74 // permission to use. For example, even though the extension may not have |
| 75 // the "tabs" permission, "tabs.create" requires no permissions so | 75 // the "tabs" permission, "tabs.create" requires no permissions so |
| 76 // HasAnyAccessToAPI("tabs") will return true. | 76 // HasAnyAccessToAPI("tabs") will return true. |
| 77 bool HasAnyAccessToAPI(const std::string& api_name) const; | 77 bool HasAnyAccessToAPI(const std::string& api_name) const; |
| 78 | 78 |
| 79 // Gets the localized permission messages that represent this set. | 79 // Gets the localized permission messages that represent this set. |
| 80 // The set of permission messages shown varies by extension type. | 80 // The set of permission messages shown varies by extension type. |
| 81 PermissionMessages GetPermissionMessages(Manifest::Type extension_type) | 81 PermissionMessages GetPermissionMessages(Manifest::Type extension_type) const; |
| 82 const; | |
| 83 | 82 |
| 84 // Gets the localized permission messages that represent this set (represented | 83 // Gets the localized permission messages that represent this set (represented |
| 85 // as strings). The set of permission messages shown varies by extension type. | 84 // as strings). The set of permission messages shown varies by extension type. |
| 86 std::vector<string16> GetWarningMessages(Manifest::Type extension_type) | 85 std::vector<string16> GetWarningMessages(Manifest::Type extension_type) const; |
| 87 const; | 86 |
| 87 // Gets the localized permission details for messages that represent this set |
| 88 // (represented as strings). The set of permission messages shown varies by |
| 89 // extension type. |
| 90 std::vector<string16> GetWarningMessagesDetails( |
| 91 Manifest::Type extension_type) const; |
| 88 | 92 |
| 89 // Returns true if this is an empty set (e.g., the default permission set). | 93 // Returns true if this is an empty set (e.g., the default permission set). |
| 90 bool IsEmpty() const; | 94 bool IsEmpty() const; |
| 91 | 95 |
| 92 // Returns true if the set has the specified API permission. | 96 // Returns true if the set has the specified API permission. |
| 93 bool HasAPIPermission(APIPermission::ID permission) const; | 97 bool HasAPIPermission(APIPermission::ID permission) const; |
| 94 | 98 |
| 95 // Returns true if the set allows the given permission with the default | 99 // Returns true if the set allows the given permission with the default |
| 96 // permission detal. | 100 // permission detal. |
| 97 bool CheckAPIPermission(APIPermission::ID permission) const; | 101 bool CheckAPIPermission(APIPermission::ID permission) const; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 // TODO(jstritar): Rename to "user_script_hosts_"? | 204 // TODO(jstritar): Rename to "user_script_hosts_"? |
| 201 URLPatternSet scriptable_hosts_; | 205 URLPatternSet scriptable_hosts_; |
| 202 | 206 |
| 203 // The list of hosts this effectively grants access to. | 207 // The list of hosts this effectively grants access to. |
| 204 URLPatternSet effective_hosts_; | 208 URLPatternSet effective_hosts_; |
| 205 }; | 209 }; |
| 206 | 210 |
| 207 } // namespace extensions | 211 } // namespace extensions |
| 208 | 212 |
| 209 #endif // CHROME_COMMON_EXTENSIONS_PERMISSIONS_PERMISSION_SET_H_ | 213 #endif // CHROME_COMMON_EXTENSIONS_PERMISSIONS_PERMISSION_SET_H_ |
| OLD | NEW |