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 <algorithm> | 9 #include <algorithm> |
10 #include <iosfwd> | 10 #include <iosfwd> |
11 #include <map> | 11 #include <map> |
12 #include <set> | 12 #include <set> |
13 #include <string> | 13 #include <string> |
14 #include <utility> | 14 #include <utility> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "base/file_path.h" | 17 #include "base/file_path.h" |
18 #include "base/gtest_prod_util.h" | 18 #include "base/gtest_prod_util.h" |
19 #include "base/hash_tables.h" | 19 #include "base/hash_tables.h" |
20 #include "base/memory/linked_ptr.h" | 20 #include "base/memory/linked_ptr.h" |
21 #include "base/memory/ref_counted.h" | 21 #include "base/memory/ref_counted.h" |
22 #include "base/memory/scoped_ptr.h" | 22 #include "base/memory/scoped_ptr.h" |
23 #include "base/synchronization/lock.h" | 23 #include "base/synchronization/lock.h" |
24 #include "chrome/common/extensions/command.h" | 24 #include "chrome/common/extensions/command.h" |
25 #include "chrome/common/extensions/extension_action.h" | 25 #include "chrome/common/extensions/extension_action.h" |
26 #include "chrome/common/extensions/extension_constants.h" | 26 #include "chrome/common/extensions/extension_constants.h" |
27 #include "chrome/common/extensions/extension_icon_set.h" | 27 #include "chrome/common/extensions/extension_icon_set.h" |
28 #include "chrome/common/extensions/extension_permission_set.h" | 28 #include "chrome/common/extensions/permissions/permission_set.h" |
29 #include "chrome/common/extensions/user_script.h" | 29 #include "chrome/common/extensions/user_script.h" |
30 #include "chrome/common/extensions/url_pattern.h" | 30 #include "chrome/common/extensions/url_pattern.h" |
31 #include "chrome/common/extensions/url_pattern_set.h" | 31 #include "chrome/common/extensions/url_pattern_set.h" |
32 #include "googleurl/src/gurl.h" | 32 #include "googleurl/src/gurl.h" |
33 #include "ui/base/accelerators/accelerator.h" | 33 #include "ui/base/accelerators/accelerator.h" |
34 #include "ui/gfx/size.h" | 34 #include "ui/gfx/size.h" |
35 | 35 |
36 class ExtensionResource; | 36 class ExtensionResource; |
37 class FileBrowserHandler; | 37 class FileBrowserHandler; |
38 class SkBitmap; | 38 class SkBitmap; |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 std::string lang; | 173 std::string lang; |
174 std::string gender; | 174 std::string gender; |
175 std::set<std::string> event_types; | 175 std::set<std::string> event_types; |
176 }; | 176 }; |
177 | 177 |
178 // OAuth2 info included in the extension. | 178 // OAuth2 info included in the extension. |
179 struct OAuth2Info { | 179 struct OAuth2Info { |
180 OAuth2Info(); | 180 OAuth2Info(); |
181 ~OAuth2Info(); | 181 ~OAuth2Info(); |
182 | 182 |
183 ExtensionOAuth2Scopes GetScopesAsSet(); | 183 OAuth2Scopes GetScopesAsSet(); |
184 | 184 |
185 std::string client_id; | 185 std::string client_id; |
186 std::vector<std::string> scopes; | 186 std::vector<std::string> scopes; |
187 }; | 187 }; |
188 | 188 |
189 struct InstallWarning { | 189 struct InstallWarning { |
190 enum Format { | 190 enum Format { |
191 // IMPORTANT: Do not build HTML strings from user or developer-supplied | 191 // IMPORTANT: Do not build HTML strings from user or developer-supplied |
192 // input. | 192 // input. |
193 FORMAT_TEXT, | 193 FORMAT_TEXT, |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 static GURL GetBaseURLFromExtensionId(const std::string& extension_id); | 425 static GURL GetBaseURLFromExtensionId(const std::string& extension_id); |
426 | 426 |
427 // Adds an extension to the scripting whitelist. Used for testing only. | 427 // Adds an extension to the scripting whitelist. Used for testing only. |
428 static void SetScriptingWhitelist(const ScriptingWhitelist& whitelist); | 428 static void SetScriptingWhitelist(const ScriptingWhitelist& whitelist); |
429 static const ScriptingWhitelist* GetScriptingWhitelist(); | 429 static const ScriptingWhitelist* GetScriptingWhitelist(); |
430 | 430 |
431 // Parses the host and api permissions from the specified permission |key| | 431 // Parses the host and api permissions from the specified permission |key| |
432 // from |manifest_|. | 432 // from |manifest_|. |
433 bool ParsePermissions(const char* key, | 433 bool ParsePermissions(const char* key, |
434 string16* error, | 434 string16* error, |
435 ExtensionAPIPermissionSet* api_permissions, | 435 APIPermissionSet* api_permissions, |
436 URLPatternSet* host_permissions); | 436 URLPatternSet* host_permissions); |
437 | 437 |
438 bool HasAPIPermission(ExtensionAPIPermission::ID permission) const; | 438 bool HasAPIPermission(APIPermission::ID permission) const; |
439 bool HasAPIPermission(const std::string& function_name) const; | 439 bool HasAPIPermission(const std::string& function_name) const; |
440 | 440 |
441 const URLPatternSet& GetEffectiveHostPermissions() const; | 441 const URLPatternSet& GetEffectiveHostPermissions() const; |
442 | 442 |
443 // Returns true if the extension can silently increase its permission level. | 443 // Returns true if the extension can silently increase its permission level. |
444 // Users must approve permissions for unpacked and packed extensions in the | 444 // Users must approve permissions for unpacked and packed extensions in the |
445 // following situations: | 445 // following situations: |
446 // - when installing or upgrading packed extensions | 446 // - when installing or upgrading packed extensions |
447 // - when installing unpacked extensions that have NPAPI plugins | 447 // - when installing unpacked extensions that have NPAPI plugins |
448 // - when either type of extension requests optional permissions | 448 // - when either type of extension requests optional permissions |
449 bool CanSilentlyIncreasePermissions() const; | 449 bool CanSilentlyIncreasePermissions() const; |
450 | 450 |
451 // Whether the extension has access to the given URL. | 451 // Whether the extension has access to the given URL. |
452 bool HasHostPermission(const GURL& url) const; | 452 bool HasHostPermission(const GURL& url) const; |
453 | 453 |
454 // Whether the extension has effective access to all hosts. This is true if | 454 // Whether the extension has effective access to all hosts. This is true if |
455 // there is a content script that matches all hosts, if there is a host | 455 // there is a content script that matches all hosts, if there is a host |
456 // permission grants access to all hosts (like <all_urls>) or an api | 456 // permission grants access to all hosts (like <all_urls>) or an api |
457 // permission that effectively grants access to all hosts (e.g. proxy, | 457 // permission that effectively grants access to all hosts (e.g. proxy, |
458 // network, etc.) | 458 // network, etc.) |
459 bool HasEffectiveAccessToAllHosts() const; | 459 bool HasEffectiveAccessToAllHosts() const; |
460 | 460 |
461 // Whether the extension effectively has all permissions (for example, by | 461 // Whether the extension effectively has all permissions (for example, by |
462 // having an NPAPI plugin). | 462 // having an NPAPI plugin). |
463 bool HasFullPermissions() const; | 463 bool HasFullPermissions() const; |
464 | 464 |
465 // Returns the full list of permission messages that this extension | 465 // Returns the full list of permission messages that this extension |
466 // should display at install time. | 466 // should display at install time. |
467 ExtensionPermissionMessages GetPermissionMessages() const; | 467 PermissionMessages GetPermissionMessages() const; |
468 | 468 |
469 // Returns the full list of permission messages that this extension | 469 // Returns the full list of permission messages that this extension |
470 // should display at install time. The messages are returned as strings | 470 // should display at install time. The messages are returned as strings |
471 // for convenience. | 471 // for convenience. |
472 std::vector<string16> GetPermissionMessageStrings() const; | 472 std::vector<string16> GetPermissionMessageStrings() const; |
473 | 473 |
474 // Sets the active |permissions|. | 474 // Sets the active |permissions|. |
475 void SetActivePermissions(const ExtensionPermissionSet* permissions) const; | 475 void SetActivePermissions(const PermissionSet* permissions) const; |
476 | 476 |
477 // Gets the extension's active permission set. | 477 // Gets the extension's active permission set. |
478 scoped_refptr<const ExtensionPermissionSet> GetActivePermissions() const; | 478 scoped_refptr<const PermissionSet> GetActivePermissions() const; |
479 | 479 |
480 // Whether context menu should be shown for page and browser actions. | 480 // Whether context menu should be shown for page and browser actions. |
481 bool ShowConfigureContextMenus() const; | 481 bool ShowConfigureContextMenus() const; |
482 | 482 |
483 // Returns the Homepage URL for this extension. If homepage_url was not | 483 // Returns the Homepage URL for this extension. If homepage_url was not |
484 // specified in the manifest, this returns the Google Gallery URL. For | 484 // specified in the manifest, this returns the Google Gallery URL. For |
485 // third-party extensions, this returns a blank GURL. | 485 // third-party extensions, this returns a blank GURL. |
486 GURL GetHomepageURL() const; | 486 GURL GetHomepageURL() const; |
487 | 487 |
488 // Returns a list of paths (relative to the extension dir) for images that | 488 // Returns a list of paths (relative to the extension dir) for images that |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 return background_scripts_; | 631 return background_scripts_; |
632 } | 632 } |
633 bool has_persistent_background_page() const { | 633 bool has_persistent_background_page() const { |
634 return has_background_page() && background_page_is_persistent_; | 634 return has_background_page() && background_page_is_persistent_; |
635 } | 635 } |
636 bool has_lazy_background_page() const { | 636 bool has_lazy_background_page() const { |
637 return has_background_page() && !background_page_is_persistent_; | 637 return has_background_page() && !background_page_is_persistent_; |
638 } | 638 } |
639 const GURL& options_url() const { return options_url_; } | 639 const GURL& options_url() const { return options_url_; } |
640 const GURL& devtools_url() const { return devtools_url_; } | 640 const GURL& devtools_url() const { return devtools_url_; } |
641 const ExtensionPermissionSet* optional_permission_set() const { | 641 const PermissionSet* optional_permission_set() const { |
642 return optional_permission_set_.get(); | 642 return optional_permission_set_.get(); |
643 } | 643 } |
644 const ExtensionPermissionSet* required_permission_set() const { | 644 const PermissionSet* required_permission_set() const { |
645 return required_permission_set_.get(); | 645 return required_permission_set_.get(); |
646 } | 646 } |
647 // Appends |new_warnings| to install_warnings(). | 647 // Appends |new_warnings| to install_warnings(). |
648 void AddInstallWarnings(const InstallWarningVector& new_warnings); | 648 void AddInstallWarnings(const InstallWarningVector& new_warnings); |
649 const InstallWarningVector& install_warnings() const { | 649 const InstallWarningVector& install_warnings() const { |
650 return install_warnings_; | 650 return install_warnings_; |
651 } | 651 } |
652 const GURL& update_url() const { return update_url_; } | 652 const GURL& update_url() const { return update_url_; } |
653 const ExtensionIconSet& icons() const { return icons_; } | 653 const ExtensionIconSet& icons() const { return icons_; } |
654 const extensions::Manifest* manifest() const { | 654 const extensions::Manifest* manifest() const { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 | 706 |
707 // We keep a cache of images loaded from extension resources based on their | 707 // We keep a cache of images loaded from extension resources based on their |
708 // path and a string representation of a size that may have been used to | 708 // path and a string representation of a size that may have been used to |
709 // scale it (or the empty string if the image is at its original size). | 709 // scale it (or the empty string if the image is at its original size). |
710 typedef std::pair<FilePath, std::string> ImageCacheKey; | 710 typedef std::pair<FilePath, std::string> ImageCacheKey; |
711 typedef std::map<ImageCacheKey, SkBitmap> ImageCache; | 711 typedef std::map<ImageCacheKey, SkBitmap> ImageCache; |
712 | 712 |
713 class RuntimeData { | 713 class RuntimeData { |
714 public: | 714 public: |
715 RuntimeData(); | 715 RuntimeData(); |
716 explicit RuntimeData(const ExtensionPermissionSet* active); | 716 explicit RuntimeData(const PermissionSet* active); |
717 ~RuntimeData(); | 717 ~RuntimeData(); |
718 | 718 |
719 void SetActivePermissions(const ExtensionPermissionSet* active); | 719 void SetActivePermissions(const PermissionSet* active); |
720 scoped_refptr<const ExtensionPermissionSet> GetActivePermissions() const; | 720 scoped_refptr<const PermissionSet> GetActivePermissions() const; |
721 | 721 |
722 const URLPatternSet* GetTabSpecificHostPermissions(int tab_id) const; | 722 const URLPatternSet* GetTabSpecificHostPermissions(int tab_id) const; |
723 void SetTabSpecificHostPermissions(int tab_id, | 723 void SetTabSpecificHostPermissions(int tab_id, |
724 const URLPatternSet& permissions); | 724 const URLPatternSet& permissions); |
725 void ClearTabSpecificHostPermissions(int tab_id); | 725 void ClearTabSpecificHostPermissions(int tab_id); |
726 | 726 |
727 private: | 727 private: |
728 friend class base::RefCountedThreadSafe<RuntimeData>; | 728 friend class base::RefCountedThreadSafe<RuntimeData>; |
729 | 729 |
730 scoped_refptr<const ExtensionPermissionSet> active_permissions_; | 730 scoped_refptr<const PermissionSet> active_permissions_; |
731 | 731 |
732 typedef std::map<int, linked_ptr<const URLPatternSet> > | 732 typedef std::map<int, linked_ptr<const URLPatternSet> > |
733 TabHostPermissionsMap; | 733 TabHostPermissionsMap; |
734 TabHostPermissionsMap tab_specific_host_permissions_; | 734 TabHostPermissionsMap tab_specific_host_permissions_; |
735 }; | 735 }; |
736 | 736 |
737 // Chooses the extension ID for an extension based on a variety of criteria. | 737 // Chooses the extension ID for an extension based on a variety of criteria. |
738 // The chosen ID will be set in |manifest|. | 738 // The chosen ID will be set in |manifest|. |
739 static bool InitExtensionID(extensions::Manifest* manifest, | 739 static bool InitExtensionID(extensions::Manifest* manifest, |
740 const FilePath& path, | 740 const FilePath& path, |
(...skipping 16 matching lines...) Expand all Loading... |
757 // TODO(aa): It is really weird the way this class essentially contains a copy | 757 // TODO(aa): It is really weird the way this class essentially contains a copy |
758 // of the underlying DictionaryValue in its members. We should decide to | 758 // of the underlying DictionaryValue in its members. We should decide to |
759 // either wrap the DictionaryValue and go with that only, or we should parse | 759 // either wrap the DictionaryValue and go with that only, or we should parse |
760 // into strong types and discard the value. But doing both is bad. | 760 // into strong types and discard the value. But doing both is bad. |
761 bool InitFromValue(int flags, string16* error); | 761 bool InitFromValue(int flags, string16* error); |
762 | 762 |
763 // The following are helpers for InitFromValue to load various features of the | 763 // The following are helpers for InitFromValue to load various features of the |
764 // extension from the manifest. | 764 // extension from the manifest. |
765 | 765 |
766 bool CheckMinimumChromeVersion(string16* error); | 766 bool CheckMinimumChromeVersion(string16* error); |
767 bool LoadAppIsolation(const ExtensionAPIPermissionSet& api_permissions, | 767 bool LoadAppIsolation(const APIPermissionSet& api_permissions, |
768 string16* error); | 768 string16* error); |
769 | 769 |
770 bool LoadRequiredFeatures(string16* error); | 770 bool LoadRequiredFeatures(string16* error); |
771 bool LoadName(string16* error); | 771 bool LoadName(string16* error); |
772 bool LoadVersion(string16* error); | 772 bool LoadVersion(string16* error); |
773 | 773 |
774 bool LoadAppFeatures(string16* error); | 774 bool LoadAppFeatures(string16* error); |
775 bool LoadExtent(const char* key, | 775 bool LoadExtent(const char* key, |
776 URLPatternSet* extent, | 776 URLPatternSet* extent, |
777 const char* list_error, | 777 const char* list_error, |
778 const char* value_error, | 778 const char* value_error, |
779 string16* error); | 779 string16* error); |
780 bool LoadLaunchContainer(string16* error); | 780 bool LoadLaunchContainer(string16* error); |
781 bool LoadLaunchURL(string16* error); | 781 bool LoadLaunchURL(string16* error); |
782 | 782 |
783 bool LoadSharedFeatures(const ExtensionAPIPermissionSet& api_permissions, | 783 bool LoadSharedFeatures(const APIPermissionSet& api_permissions, |
784 string16* error); | 784 string16* error); |
785 bool LoadDescription(string16* error); | 785 bool LoadDescription(string16* error); |
786 bool LoadManifestVersion(string16* error); | 786 bool LoadManifestVersion(string16* error); |
787 bool LoadHomepageURL(string16* error); | 787 bool LoadHomepageURL(string16* error); |
788 bool LoadUpdateURL(string16* error); | 788 bool LoadUpdateURL(string16* error); |
789 bool LoadIcons(string16* error); | 789 bool LoadIcons(string16* error); |
790 bool LoadCommands(string16* error); | 790 bool LoadCommands(string16* error); |
791 bool LoadPlugins(string16* error); | 791 bool LoadPlugins(string16* error); |
792 bool LoadNaClModules(string16* error); | 792 bool LoadNaClModules(string16* error); |
793 bool LoadWebAccessibleResources(string16* error); | 793 bool LoadWebAccessibleResources(string16* error); |
794 bool LoadSandboxedPages(string16* error); | 794 bool LoadSandboxedPages(string16* error); |
795 bool CheckRequirements(string16* error); | 795 bool CheckRequirements(string16* error); |
796 bool LoadDefaultLocale(string16* error); | 796 bool LoadDefaultLocale(string16* error); |
797 bool LoadOfflineEnabled(string16* error); | 797 bool LoadOfflineEnabled(string16* error); |
798 bool LoadOptionsPage(string16* error); | 798 bool LoadOptionsPage(string16* error); |
799 bool LoadBackgroundScripts(string16* error); | 799 bool LoadBackgroundScripts(string16* error); |
800 bool LoadBackgroundScripts(const std::string& key, string16* error); | 800 bool LoadBackgroundScripts(const std::string& key, string16* error); |
801 bool LoadBackgroundPage(const ExtensionAPIPermissionSet& api_permissions, | 801 bool LoadBackgroundPage(const APIPermissionSet& api_permissions, |
802 string16* error); | 802 string16* error); |
803 bool LoadBackgroundPage(const std::string& key, | 803 bool LoadBackgroundPage(const std::string& key, |
804 const ExtensionAPIPermissionSet& api_permissions, | 804 const APIPermissionSet& api_permissions, |
805 string16* error); | 805 string16* error); |
806 bool LoadBackgroundPersistent( | 806 bool LoadBackgroundPersistent( |
807 const ExtensionAPIPermissionSet& api_permissions, | 807 const APIPermissionSet& api_permissions, |
808 string16* error); | 808 string16* error); |
809 bool LoadBackgroundAllowJSAccess( | 809 bool LoadBackgroundAllowJSAccess( |
810 const ExtensionAPIPermissionSet& api_permissions, | 810 const APIPermissionSet& api_permissions, |
811 string16* error); | 811 string16* error); |
812 // Parses a single action in the manifest. | 812 // Parses a single action in the manifest. |
813 bool LoadWebIntentAction(const std::string& action_name, | 813 bool LoadWebIntentAction(const std::string& action_name, |
814 const base::DictionaryValue& intent_service, | 814 const base::DictionaryValue& intent_service, |
815 string16* error); | 815 string16* error); |
816 bool LoadWebIntentServices(string16* error); | 816 bool LoadWebIntentServices(string16* error); |
817 bool LoadExtensionFeatures(const ExtensionAPIPermissionSet& api_permissions, | 817 bool LoadExtensionFeatures(const APIPermissionSet& api_permissions, |
818 string16* error); | 818 string16* error); |
819 bool LoadDevToolsPage(string16* error); | 819 bool LoadDevToolsPage(string16* error); |
820 bool LoadInputComponents(const ExtensionAPIPermissionSet& api_permissions, | 820 bool LoadInputComponents(const APIPermissionSet& api_permissions, |
821 string16* error); | 821 string16* error); |
822 bool LoadContentScripts(string16* error); | 822 bool LoadContentScripts(string16* error); |
823 bool LoadPageAction(string16* error); | 823 bool LoadPageAction(string16* error); |
824 bool LoadBrowserAction(string16* error); | 824 bool LoadBrowserAction(string16* error); |
825 bool LoadScriptBadge(string16* error); | 825 bool LoadScriptBadge(string16* error); |
826 bool LoadFileBrowserHandlers(string16* error); | 826 bool LoadFileBrowserHandlers(string16* error); |
827 // Helper method to load a FileBrowserHandlerList from the manifest. | 827 // Helper method to load a FileBrowserHandlerList from the manifest. |
828 FileBrowserHandlerList* LoadFileBrowserHandlersHelper( | 828 FileBrowserHandlerList* LoadFileBrowserHandlersHelper( |
829 const base::ListValue* extension_actions, string16* error); | 829 const base::ListValue* extension_actions, string16* error); |
830 // Helper method to load an FileBrowserHandler from manifest. | 830 // Helper method to load an FileBrowserHandler from manifest. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 // |override_url|. | 886 // |override_url|. |
887 void OverrideLaunchUrl(const GURL& override_url); | 887 void OverrideLaunchUrl(const GURL& override_url); |
888 | 888 |
889 // Custom checks for the experimental permission that can't be expressed in | 889 // Custom checks for the experimental permission that can't be expressed in |
890 // _permission_features.json. | 890 // _permission_features.json. |
891 bool CanSpecifyExperimentalPermission() const; | 891 bool CanSpecifyExperimentalPermission() const; |
892 | 892 |
893 // Checks whether the host |pattern| is allowed for this extension, given API | 893 // Checks whether the host |pattern| is allowed for this extension, given API |
894 // permissions |permissions|. | 894 // permissions |permissions|. |
895 bool CanSpecifyHostPermission(const URLPattern& pattern, | 895 bool CanSpecifyHostPermission(const URLPattern& pattern, |
896 const ExtensionAPIPermissionSet& permissions) const; | 896 const APIPermissionSet& permissions) const; |
897 | 897 |
898 // Check that platform app features are valid. Called after InitFromValue. | 898 // Check that platform app features are valid. Called after InitFromValue. |
899 bool CheckPlatformAppFeatures(std::string* utf8_error); | 899 bool CheckPlatformAppFeatures(std::string* utf8_error); |
900 | 900 |
901 // Check that features don't conflict. Called after InitFromValue. | 901 // Check that features don't conflict. Called after InitFromValue. |
902 bool CheckConflictingFeatures(std::string* utf8_error); | 902 bool CheckConflictingFeatures(std::string* utf8_error); |
903 | 903 |
904 // Cached images for this extension. This should only be touched on the UI | 904 // Cached images for this extension. This should only be touched on the UI |
905 // thread. | 905 // thread. |
906 mutable ImageCache image_cache_; | 906 mutable ImageCache image_cache_; |
(...skipping 30 matching lines...) Expand all Loading... |
937 bool offline_enabled_; | 937 bool offline_enabled_; |
938 | 938 |
939 // Defines the set of URLs in the extension's web content. | 939 // Defines the set of URLs in the extension's web content. |
940 URLPatternSet extent_; | 940 URLPatternSet extent_; |
941 | 941 |
942 // The extension runtime data. | 942 // The extension runtime data. |
943 mutable base::Lock runtime_data_lock_; | 943 mutable base::Lock runtime_data_lock_; |
944 mutable RuntimeData runtime_data_; | 944 mutable RuntimeData runtime_data_; |
945 | 945 |
946 // The set of permissions the extension can request at runtime. | 946 // The set of permissions the extension can request at runtime. |
947 scoped_refptr<const ExtensionPermissionSet> optional_permission_set_; | 947 scoped_refptr<const PermissionSet> optional_permission_set_; |
948 | 948 |
949 // The extension's required / default set of permissions. | 949 // The extension's required / default set of permissions. |
950 scoped_refptr<const ExtensionPermissionSet> required_permission_set_; | 950 scoped_refptr<const PermissionSet> required_permission_set_; |
951 | 951 |
952 // Any warnings that occurred when trying to create/parse the extension. | 952 // Any warnings that occurred when trying to create/parse the extension. |
953 InstallWarningVector install_warnings_; | 953 InstallWarningVector install_warnings_; |
954 | 954 |
955 // The icons for the extension. | 955 // The icons for the extension. |
956 ExtensionIconSet icons_; | 956 ExtensionIconSet icons_; |
957 | 957 |
958 // The base extension url for the extension. | 958 // The base extension url for the extension. |
959 GURL extension_url_; | 959 GURL extension_url_; |
960 | 960 |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1168 }; | 1168 }; |
1169 | 1169 |
1170 Reason reason; | 1170 Reason reason; |
1171 | 1171 |
1172 // The extension who's permissions have changed. | 1172 // The extension who's permissions have changed. |
1173 const Extension* extension; | 1173 const Extension* extension; |
1174 | 1174 |
1175 // The permissions that have changed. For Reason::ADDED, this would contain | 1175 // The permissions that have changed. For Reason::ADDED, this would contain |
1176 // only the permissions that have added, and for Reason::REMOVED, this would | 1176 // only the permissions that have added, and for Reason::REMOVED, this would |
1177 // only contain the removed permissions. | 1177 // only contain the removed permissions. |
1178 const ExtensionPermissionSet* permissions; | 1178 const PermissionSet* permissions; |
1179 | 1179 |
1180 UpdatedExtensionPermissionsInfo( | 1180 UpdatedExtensionPermissionsInfo( |
1181 const Extension* extension, | 1181 const Extension* extension, |
1182 const ExtensionPermissionSet* permissions, | 1182 const PermissionSet* permissions, |
1183 Reason reason); | 1183 Reason reason); |
1184 }; | 1184 }; |
1185 | 1185 |
1186 } // namespace extensions | 1186 } // namespace extensions |
1187 | 1187 |
1188 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 1188 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |