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 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 #include <map> | 10 #include <map> |
11 #include <set> | 11 #include <set> |
12 #include <string> | 12 #include <string> |
13 #include <utility> | 13 #include <utility> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "base/file_path.h" | 16 #include "base/file_path.h" |
17 #include "base/gtest_prod_util.h" | 17 #include "base/gtest_prod_util.h" |
18 #include "base/hash_tables.h" | 18 #include "base/hash_tables.h" |
19 #include "base/memory/linked_ptr.h" | 19 #include "base/memory/linked_ptr.h" |
20 #include "base/memory/ref_counted.h" | 20 #include "base/memory/ref_counted.h" |
21 #include "base/memory/scoped_ptr.h" | 21 #include "base/memory/scoped_ptr.h" |
22 #include "base/synchronization/lock.h" | 22 #include "base/synchronization/lock.h" |
23 #include "chrome/common/extensions/command.h" | 23 #include "chrome/common/extensions/command.h" |
24 #include "chrome/common/extensions/extension_action.h" | 24 #include "chrome/common/extensions/extension_action.h" |
25 #include "chrome/common/extensions/extension_constants.h" | 25 #include "chrome/common/extensions/extension_constants.h" |
26 #include "chrome/common/extensions/extension_icon_set.h" | 26 #include "chrome/common/extensions/extension_icon_set.h" |
27 #include "chrome/common/extensions/permissions/api_permission.h" | 27 #include "chrome/common/extensions/permissions/api_permission.h" |
| 28 #include "chrome/common/extensions/permissions/api_permission_set.h" |
28 #include "chrome/common/extensions/permissions/permission_message.h" | 29 #include "chrome/common/extensions/permissions/permission_message.h" |
29 #include "chrome/common/extensions/user_script.h" | 30 #include "chrome/common/extensions/user_script.h" |
30 #include "chrome/common/extensions/url_pattern.h" | 31 #include "chrome/common/extensions/url_pattern.h" |
31 #include "chrome/common/extensions/url_pattern_set.h" | 32 #include "chrome/common/extensions/url_pattern_set.h" |
32 #include "googleurl/src/gurl.h" | 33 #include "googleurl/src/gurl.h" |
33 #include "ui/base/accelerators/accelerator.h" | 34 #include "ui/base/accelerators/accelerator.h" |
34 #include "ui/gfx/size.h" | 35 #include "ui/gfx/size.h" |
35 | 36 |
36 class ExtensionResource; | 37 class ExtensionResource; |
37 class FileBrowserHandler; | 38 class FileBrowserHandler; |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 // from |manifest_|. | 436 // from |manifest_|. |
436 bool ParsePermissions(const char* key, | 437 bool ParsePermissions(const char* key, |
437 string16* error, | 438 string16* error, |
438 APIPermissionSet* api_permissions, | 439 APIPermissionSet* api_permissions, |
439 URLPatternSet* host_permissions); | 440 URLPatternSet* host_permissions); |
440 | 441 |
441 bool HasAPIPermission(APIPermission::ID permission) const; | 442 bool HasAPIPermission(APIPermission::ID permission) const; |
442 bool HasAPIPermission(const std::string& function_name) const; | 443 bool HasAPIPermission(const std::string& function_name) const; |
443 bool HasAPIPermissionForTab(int tab_id, APIPermission::ID permission) const; | 444 bool HasAPIPermissionForTab(int tab_id, APIPermission::ID permission) const; |
444 | 445 |
| 446 bool CheckAPIPermissionWithDetail(APIPermission::ID permission, |
| 447 const APIPermissionDetail::CheckParam* param) const; |
| 448 |
445 const URLPatternSet& GetEffectiveHostPermissions() const; | 449 const URLPatternSet& GetEffectiveHostPermissions() const; |
446 | 450 |
447 // Returns true if the extension can silently increase its permission level. | 451 // Returns true if the extension can silently increase its permission level. |
448 // Users must approve permissions for unpacked and packed extensions in the | 452 // Users must approve permissions for unpacked and packed extensions in the |
449 // following situations: | 453 // following situations: |
450 // - when installing or upgrading packed extensions | 454 // - when installing or upgrading packed extensions |
451 // - when installing unpacked extensions that have NPAPI plugins | 455 // - when installing unpacked extensions that have NPAPI plugins |
452 // - when either type of extension requests optional permissions | 456 // - when either type of extension requests optional permissions |
453 bool CanSilentlyIncreasePermissions() const; | 457 bool CanSilentlyIncreasePermissions() const; |
454 | 458 |
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1192 | 1196 |
1193 UpdatedExtensionPermissionsInfo( | 1197 UpdatedExtensionPermissionsInfo( |
1194 const Extension* extension, | 1198 const Extension* extension, |
1195 const PermissionSet* permissions, | 1199 const PermissionSet* permissions, |
1196 Reason reason); | 1200 Reason reason); |
1197 }; | 1201 }; |
1198 | 1202 |
1199 } // namespace extensions | 1203 } // namespace extensions |
1200 | 1204 |
1201 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 1205 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |