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 // We distinguish between install/upgrade and runtime to simplify extension |
400 // mechanisms that are implicitly trusted. | 400 // development. We prompt at install time for packaged extensions and unpacked |
Yoyo Zhou
2012/01/24 19:42:23
packaged -> packed
| |
401 bool CanSilentlyIncreasePermissions() const; | 401 // extensions that contain plugins. We prompt for both types of extensions |
402 | 402 // when they request permissions with the permissions API. |
403 bool CanSilentlyIncreasePermissionsDuringInstall() const; | |
404 bool CanSilentlyIncreasePermissionsWhileRunning() const; | |
jstritar
2012/01/24 17:54:44
Are these methods confusing?
Yoyo Zhou
2012/01/24 19:42:23
Maybe "upgrade" instead of "install"? (Does it mak
jstritar
2012/01/25 17:34:18
I ended up going back to just one CanSilentlyIncre
| |
403 | 405 |
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; |
(...skipping 543 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 |