| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 CHROME_COMMON_EXTENSIONS_PERMISSIONS_PERMISSIONS_DATA_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_PERMISSIONS_PERMISSIONS_DATA_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_PERMISSIONS_PERMISSIONS_DATA_H_ | 6 #define CHROME_COMMON_EXTENSIONS_PERMISSIONS_PERMISSIONS_DATA_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 126 |
| 127 // Whether the |extension| has effective access to all hosts. This is true if | 127 // Whether the |extension| has effective access to all hosts. This is true if |
| 128 // there is a content script that matches all hosts, if there is a host | 128 // there is a content script that matches all hosts, if there is a host |
| 129 // permission grants access to all hosts (like <all_urls>) or an api | 129 // permission grants access to all hosts (like <all_urls>) or an api |
| 130 // permission that effectively grants access to all hosts (e.g. proxy, | 130 // permission that effectively grants access to all hosts (e.g. proxy, |
| 131 // network, etc.) | 131 // network, etc.) |
| 132 static bool HasEffectiveAccessToAllHosts(const Extension* extension); | 132 static bool HasEffectiveAccessToAllHosts(const Extension* extension); |
| 133 | 133 |
| 134 // Returns the full list of permission messages that the given |extension| | 134 // Returns the full list of permission messages that the given |extension| |
| 135 // should display at install time. | 135 // should display at install time. |
| 136 static PermissionMessages GetPermissionMessages(const Extension* extension); | 136 // PermissionMessages come in two flavors, overview or detailed and the way to |
| 137 // request one or the other is through the |details_only| parameter. |
| 138 static PermissionMessages GetPermissionMessages(const Extension* extension, |
| 139 bool details_only); |
| 137 // Returns the full list of permission messages that the given |extension| | 140 // Returns the full list of permission messages that the given |extension| |
| 138 // should display at install time. The messages are returned as strings | 141 // should display at install time. The messages are returned as strings |
| 139 // for convenience. | 142 // for convenience. |
| 143 // PermissionMessages come in two flavors, overview or detailed and the way to |
| 144 // request one or the other is through the |details_only| parameter. |
| 140 static std::vector<string16> GetPermissionMessageStrings( | 145 static std::vector<string16> GetPermissionMessageStrings( |
| 141 const Extension* extension); | 146 const Extension* extension, bool details_only); |
| 142 | 147 |
| 143 // Returns true if the given |extension| can execute script on a page. If a | 148 // Returns true if the given |extension| can execute script on a page. If a |
| 144 // UserScript object is passed, permission to run that specific script is | 149 // UserScript object is passed, permission to run that specific script is |
| 145 // checked (using its matches list). Otherwise, permission to execute script | 150 // checked (using its matches list). Otherwise, permission to execute script |
| 146 // programmatically is checked (using the extension's host permission). | 151 // programmatically is checked (using the extension's host permission). |
| 147 // | 152 // |
| 148 // This method is also aware of certain special pages that extensions are | 153 // This method is also aware of certain special pages that extensions are |
| 149 // usually not allowed to run script on. | 154 // usually not allowed to run script on. |
| 150 static bool CanExecuteScriptOnPage(const Extension* extension, | 155 static bool CanExecuteScriptOnPage(const Extension* extension, |
| 151 const GURL& document_url, | 156 const GURL& document_url, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 mutable scoped_refptr<const PermissionSet> active_permissions_; | 201 mutable scoped_refptr<const PermissionSet> active_permissions_; |
| 197 | 202 |
| 198 mutable TabPermissionsMap tab_specific_permissions_; | 203 mutable TabPermissionsMap tab_specific_permissions_; |
| 199 | 204 |
| 200 DISALLOW_COPY_AND_ASSIGN(PermissionsData); | 205 DISALLOW_COPY_AND_ASSIGN(PermissionsData); |
| 201 }; | 206 }; |
| 202 | 207 |
| 203 } // namespace extensions | 208 } // namespace extensions |
| 204 | 209 |
| 205 #endif // CHROME_COMMON_EXTENSIONS_PERMISSIONS_PERMISSIONS_DATA_H_ | 210 #endif // CHROME_COMMON_EXTENSIONS_PERMISSIONS_PERMISSIONS_DATA_H_ |
| OLD | NEW |