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> |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 // Returns true if the extension has a content script declared at |url|. | 564 // Returns true if the extension has a content script declared at |url|. |
565 bool HasContentScriptAtURL(const GURL& url) const; | 565 bool HasContentScriptAtURL(const GURL& url) const; |
566 | 566 |
567 // Gets the tab-specific host permissions of |tab_id|, or NULL if there | 567 // Gets the tab-specific host permissions of |tab_id|, or NULL if there |
568 // aren't any. | 568 // aren't any. |
569 scoped_refptr<const PermissionSet> GetTabSpecificPermissions(int tab_id) | 569 scoped_refptr<const PermissionSet> GetTabSpecificPermissions(int tab_id) |
570 const; | 570 const; |
571 | 571 |
572 // Updates the tab-specific permissions of |tab_id| to include those from | 572 // Updates the tab-specific permissions of |tab_id| to include those from |
573 // |permissions|. | 573 // |permissions|. |
574 void UpdateTabSpecificPermissions(int tab_id, | 574 void UpdateTabSpecificPermissions( |
575 const PermissionSet* permissions) const; | 575 int tab_id, |
| 576 scoped_refptr<const PermissionSet> permissions) const; |
576 | 577 |
577 // Clears the tab-specific permissions of |tab_id|. | 578 // Clears the tab-specific permissions of |tab_id|. |
578 void ClearTabSpecificPermissions(int tab_id) const; | 579 void ClearTabSpecificPermissions(int tab_id) const; |
579 | 580 |
580 // Accessors: | 581 // Accessors: |
581 | 582 |
582 const FilePath& path() const { return path_; } | 583 const FilePath& path() const { return path_; } |
583 const GURL& url() const { return extension_url_; } | 584 const GURL& url() const { return extension_url_; } |
584 Location location() const; | 585 Location location() const; |
585 const std::string& id() const; | 586 const std::string& id() const; |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 public: | 722 public: |
722 RuntimeData(); | 723 RuntimeData(); |
723 explicit RuntimeData(const PermissionSet* active); | 724 explicit RuntimeData(const PermissionSet* active); |
724 ~RuntimeData(); | 725 ~RuntimeData(); |
725 | 726 |
726 void SetActivePermissions(const PermissionSet* active); | 727 void SetActivePermissions(const PermissionSet* active); |
727 scoped_refptr<const PermissionSet> GetActivePermissions() const; | 728 scoped_refptr<const PermissionSet> GetActivePermissions() const; |
728 | 729 |
729 scoped_refptr<const PermissionSet> GetTabSpecificPermissions(int tab_id) | 730 scoped_refptr<const PermissionSet> GetTabSpecificPermissions(int tab_id) |
730 const; | 731 const; |
731 void UpdateTabSpecificPermissions(int tab_id, | 732 void UpdateTabSpecificPermissions( |
732 const PermissionSet* permissions); | 733 int tab_id, |
| 734 scoped_refptr<const PermissionSet> permissions); |
733 void ClearTabSpecificPermissions(int tab_id); | 735 void ClearTabSpecificPermissions(int tab_id); |
734 | 736 |
735 private: | 737 private: |
736 friend class base::RefCountedThreadSafe<RuntimeData>; | 738 friend class base::RefCountedThreadSafe<RuntimeData>; |
737 | 739 |
738 scoped_refptr<const PermissionSet> active_permissions_; | 740 scoped_refptr<const PermissionSet> active_permissions_; |
739 | 741 |
740 typedef std::map<int, scoped_refptr<const PermissionSet> > | 742 typedef std::map<int, scoped_refptr<const PermissionSet> > |
741 TabPermissionsMap; | 743 TabPermissionsMap; |
742 TabPermissionsMap tab_specific_permissions_; | 744 TabPermissionsMap tab_specific_permissions_; |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1187 | 1189 |
1188 UpdatedExtensionPermissionsInfo( | 1190 UpdatedExtensionPermissionsInfo( |
1189 const Extension* extension, | 1191 const Extension* extension, |
1190 const PermissionSet* permissions, | 1192 const PermissionSet* permissions, |
1191 Reason reason); | 1193 Reason reason); |
1192 }; | 1194 }; |
1193 | 1195 |
1194 } // namespace extensions | 1196 } // namespace extensions |
1195 | 1197 |
1196 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 1198 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |