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_EXTENSION_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 string16* error, | 389 string16* error, |
390 ExtensionAPIPermissionSet* api_permissions, | 390 ExtensionAPIPermissionSet* api_permissions, |
391 URLPatternSet* host_permissions); | 391 URLPatternSet* host_permissions); |
392 | 392 |
393 bool HasAPIPermission(ExtensionAPIPermission::ID permission) const; | 393 bool HasAPIPermission(ExtensionAPIPermission::ID permission) const; |
394 bool HasAPIPermission(const std::string& function_name) const; | 394 bool HasAPIPermission(const std::string& function_name) const; |
395 | 395 |
396 const URLPatternSet& GetEffectiveHostPermissions() const; | 396 const URLPatternSet& GetEffectiveHostPermissions() const; |
397 | 397 |
398 // Returns true if the extension can silently increase its permission level. | 398 // Returns true if the extension can silently increase its permission level. |
399 // Extensions that can silently increase permissions are installed through | 399 // Users must approve permissions for unpacked and packed extensions in the |
400 // mechanisms that are implicitly trusted. | 400 // following situations: |
| 401 // - when installing or upgrading packed extensions |
| 402 // - when installing unpacked extensions that have NPAPI plugins |
| 403 // - when either type of extension requests optional permissions |
401 bool CanSilentlyIncreasePermissions() const; | 404 bool CanSilentlyIncreasePermissions() const; |
402 | 405 |
403 | |
404 // Whether the extension has access to the given URL. | 406 // Whether the extension has access to the given URL. |
405 bool HasHostPermission(const GURL& url) const; | 407 bool HasHostPermission(const GURL& url) const; |
406 | 408 |
407 // Whether the extension has effective access to all hosts. This is true if | 409 // Whether the extension has effective access to all hosts. This is true if |
408 // there is a content script that matches all hosts, if there is a host | 410 // there is a content script that matches all hosts, if there is a host |
409 // permission grants access to all hosts (like <all_urls>) or an api | 411 // permission grants access to all hosts (like <all_urls>) or an api |
410 // permission that effectively grants access to all hosts (e.g. proxy, | 412 // permission that effectively grants access to all hosts (e.g. proxy, |
411 // network, etc.) | 413 // network, etc.) |
412 bool HasEffectiveAccessToAllHosts() const; | 414 bool HasEffectiveAccessToAllHosts() const; |
413 | 415 |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 // only contain the removed permissions. | 958 // only contain the removed permissions. |
957 const ExtensionPermissionSet* permissions; | 959 const ExtensionPermissionSet* permissions; |
958 | 960 |
959 UpdatedExtensionPermissionsInfo( | 961 UpdatedExtensionPermissionsInfo( |
960 const Extension* extension, | 962 const Extension* extension, |
961 const ExtensionPermissionSet* permissions, | 963 const ExtensionPermissionSet* permissions, |
962 Reason reason); | 964 Reason reason); |
963 }; | 965 }; |
964 | 966 |
965 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 967 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |