| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 static GURL GetResourceURL(const GURL& extension_url, | 238 static GURL GetResourceURL(const GURL& extension_url, |
| 239 const std::string& relative_path); | 239 const std::string& relative_path); |
| 240 GURL GetResourceURL(const std::string& relative_path) const { | 240 GURL GetResourceURL(const std::string& relative_path) const { |
| 241 return GetResourceURL(url(), relative_path); | 241 return GetResourceURL(url(), relative_path); |
| 242 } | 242 } |
| 243 | 243 |
| 244 // Returns true if the resource matches a pattern in the pattern_set. | 244 // Returns true if the resource matches a pattern in the pattern_set. |
| 245 bool ResourceMatches(const URLPatternSet& pattern_set, | 245 bool ResourceMatches(const URLPatternSet& pattern_set, |
| 246 const std::string& resource) const; | 246 const std::string& resource) const; |
| 247 | 247 |
| 248 // Returns true if the specified page is sandboxed (served in a unique | |
| 249 // origin). | |
| 250 bool IsSandboxedPage(const std::string& relative_path) const; | |
| 251 | |
| 252 // Returns the Content Security Policy that the specified resource should be | 248 // Returns the Content Security Policy that the specified resource should be |
| 253 // served with. | 249 // served with. |
| 254 std::string GetResourceContentSecurityPolicy(const std::string& relative_path) | 250 std::string GetResourceContentSecurityPolicy(const std::string& relative_path) |
| 255 const; | 251 const; |
| 256 | 252 |
| 257 // Returns an extension resource object. |relative_path| should be UTF8 | 253 // Returns an extension resource object. |relative_path| should be UTF8 |
| 258 // encoded. | 254 // encoded. |
| 259 ExtensionResource GetResource(const std::string& relative_path) const; | 255 ExtensionResource GetResource(const std::string& relative_path) const; |
| 260 | 256 |
| 261 // As above, but with |relative_path| following the file system's encoding. | 257 // As above, but with |relative_path| following the file system's encoding. |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 const char* list_error, | 589 const char* list_error, |
| 594 const char* value_error, | 590 const char* value_error, |
| 595 string16* error); | 591 string16* error); |
| 596 bool LoadLaunchContainer(string16* error); | 592 bool LoadLaunchContainer(string16* error); |
| 597 bool LoadLaunchURL(string16* error); | 593 bool LoadLaunchURL(string16* error); |
| 598 | 594 |
| 599 bool LoadSharedFeatures(string16* error); | 595 bool LoadSharedFeatures(string16* error); |
| 600 bool LoadDescription(string16* error); | 596 bool LoadDescription(string16* error); |
| 601 bool LoadManifestVersion(string16* error); | 597 bool LoadManifestVersion(string16* error); |
| 602 bool LoadNaClModules(string16* error); | 598 bool LoadNaClModules(string16* error); |
| 603 bool LoadSandboxedPages(string16* error); | |
| 604 // Must be called after the "plugins" key has been parsed. | 599 // Must be called after the "plugins" key has been parsed. |
| 605 bool LoadRequirements(string16* error); | 600 bool LoadRequirements(string16* error); |
| 606 bool LoadKioskEnabled(string16* error); | 601 bool LoadKioskEnabled(string16* error); |
| 607 bool LoadOfflineEnabled(string16* error); | 602 bool LoadOfflineEnabled(string16* error); |
| 608 bool LoadExtensionFeatures(string16* error); | 603 bool LoadExtensionFeatures(string16* error); |
| 609 bool LoadContentScripts(string16* error); | 604 bool LoadContentScripts(string16* error); |
| 610 bool LoadBrowserAction(string16* error); | 605 bool LoadBrowserAction(string16* error); |
| 611 bool LoadSystemIndicator(string16* error); | 606 bool LoadSystemIndicator(string16* error); |
| 612 bool LoadTextToSpeechVoices(string16* error); | 607 bool LoadTextToSpeechVoices(string16* error); |
| 613 bool LoadIncognitoMode(string16* error); | 608 bool LoadIncognitoMode(string16* error); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 | 724 |
| 730 // Paths to the content scripts the extension contains. | 725 // Paths to the content scripts the extension contains. |
| 731 UserScriptList content_scripts_; | 726 UserScriptList content_scripts_; |
| 732 | 727 |
| 733 // The extension's system indicator, if any. | 728 // The extension's system indicator, if any. |
| 734 scoped_ptr<ActionInfo> system_indicator_info_; | 729 scoped_ptr<ActionInfo> system_indicator_info_; |
| 735 | 730 |
| 736 // Optional list of NaCl modules and associated properties. | 731 // Optional list of NaCl modules and associated properties. |
| 737 std::vector<NaClModuleInfo> nacl_modules_; | 732 std::vector<NaClModuleInfo> nacl_modules_; |
| 738 | 733 |
| 739 // Optional list of extension pages that are sandboxed (served from a unique | |
| 740 // origin with a different Content Security Policy). | |
| 741 URLPatternSet sandboxed_pages_; | |
| 742 | |
| 743 // Content Security Policy that should be used to enforce the sandbox used | |
| 744 // by sandboxed pages (guaranteed to have the "sandbox" directive without the | |
| 745 // "allow-same-origin" token). | |
| 746 std::string sandboxed_pages_content_security_policy_; | |
| 747 | |
| 748 // The public key used to sign the contents of the crx package. | 734 // The public key used to sign the contents of the crx package. |
| 749 std::string public_key_; | 735 std::string public_key_; |
| 750 | 736 |
| 751 // A file containing a list of sites for Managed Mode. | 737 // A file containing a list of sites for Managed Mode. |
| 752 base::FilePath content_pack_site_list_; | 738 base::FilePath content_pack_site_list_; |
| 753 | 739 |
| 754 // The manifest from which this extension was created. | 740 // The manifest from which this extension was created. |
| 755 scoped_ptr<Manifest> manifest_; | 741 scoped_ptr<Manifest> manifest_; |
| 756 | 742 |
| 757 // Stored parsed manifest data. | 743 // Stored parsed manifest data. |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 | 844 |
| 859 UpdatedExtensionPermissionsInfo( | 845 UpdatedExtensionPermissionsInfo( |
| 860 const Extension* extension, | 846 const Extension* extension, |
| 861 const PermissionSet* permissions, | 847 const PermissionSet* permissions, |
| 862 Reason reason); | 848 Reason reason); |
| 863 }; | 849 }; |
| 864 | 850 |
| 865 } // namespace extensions | 851 } // namespace extensions |
| 866 | 852 |
| 867 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 853 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
| OLD | NEW |