| 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 <map> | 10 #include <map> |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 GURL GetResourceURL(const std::string& relative_path) const { | 326 GURL GetResourceURL(const std::string& relative_path) const { |
| 327 return GetResourceURL(url(), relative_path); | 327 return GetResourceURL(url(), relative_path); |
| 328 } | 328 } |
| 329 | 329 |
| 330 // Returns true if the specified resource is web accessible. | 330 // Returns true if the specified resource is web accessible. |
| 331 bool IsResourceWebAccessible(const std::string& relative_path) const; | 331 bool IsResourceWebAccessible(const std::string& relative_path) const; |
| 332 | 332 |
| 333 // Returns true when 'web_accessible_resources' are defined for the extension. | 333 // Returns true when 'web_accessible_resources' are defined for the extension. |
| 334 bool HasWebAccessibleResources() const; | 334 bool HasWebAccessibleResources() const; |
| 335 | 335 |
| 336 // Returns true if the specified resource should be served in a sandboxed |
| 337 // unique origin. |
| 338 bool IsResourceSandboxed(const std::string& relative_path) const; |
| 339 |
| 336 // Returns an extension resource object. |relative_path| should be UTF8 | 340 // Returns an extension resource object. |relative_path| should be UTF8 |
| 337 // encoded. | 341 // encoded. |
| 338 ExtensionResource GetResource(const std::string& relative_path) const; | 342 ExtensionResource GetResource(const std::string& relative_path) const; |
| 339 | 343 |
| 340 // As above, but with |relative_path| following the file system's encoding. | 344 // As above, but with |relative_path| following the file system's encoding. |
| 341 ExtensionResource GetResource(const FilePath& relative_path) const; | 345 ExtensionResource GetResource(const FilePath& relative_path) const; |
| 342 | 346 |
| 343 // |input| is expected to be the text of an rsa public or private key. It | 347 // |input| is expected to be the text of an rsa public or private key. It |
| 344 // tolerates the presence or absence of bracking header/footer like this: | 348 // tolerates the presence or absence of bracking header/footer like this: |
| 345 // -----(BEGIN|END) [RSA PUBLIC/PRIVATE] KEY----- | 349 // -----(BEGIN|END) [RSA PUBLIC/PRIVATE] KEY----- |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 string16* error); | 736 string16* error); |
| 733 bool LoadDescription(string16* error); | 737 bool LoadDescription(string16* error); |
| 734 bool LoadManifestVersion(string16* error); | 738 bool LoadManifestVersion(string16* error); |
| 735 bool LoadHomepageURL(string16* error); | 739 bool LoadHomepageURL(string16* error); |
| 736 bool LoadUpdateURL(string16* error); | 740 bool LoadUpdateURL(string16* error); |
| 737 bool LoadIcons(string16* error); | 741 bool LoadIcons(string16* error); |
| 738 bool LoadCommands(string16* error); | 742 bool LoadCommands(string16* error); |
| 739 bool LoadPlugins(string16* error); | 743 bool LoadPlugins(string16* error); |
| 740 bool LoadNaClModules(string16* error); | 744 bool LoadNaClModules(string16* error); |
| 741 bool LoadWebAccessibleResources(string16* error); | 745 bool LoadWebAccessibleResources(string16* error); |
| 746 bool LoadSandboxedResources(string16* error); |
| 742 bool CheckRequirements(string16* error); | 747 bool CheckRequirements(string16* error); |
| 743 bool LoadDefaultLocale(string16* error); | 748 bool LoadDefaultLocale(string16* error); |
| 744 bool LoadOfflineEnabled(string16* error); | 749 bool LoadOfflineEnabled(string16* error); |
| 745 bool LoadOptionsPage(string16* error); | 750 bool LoadOptionsPage(string16* error); |
| 746 bool LoadBackgroundScripts(string16* error); | 751 bool LoadBackgroundScripts(string16* error); |
| 747 bool LoadBackgroundPage(const ExtensionAPIPermissionSet& api_permissions, | 752 bool LoadBackgroundPage(const ExtensionAPIPermissionSet& api_permissions, |
| 748 string16* error); | 753 string16* error); |
| 749 bool LoadBackgroundPersistent( | 754 bool LoadBackgroundPersistent( |
| 750 const ExtensionAPIPermissionSet& api_permissions, | 755 const ExtensionAPIPermissionSet& api_permissions, |
| 751 string16* error); | 756 string16* error); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 std::vector<InputComponentInfo> input_components_; | 945 std::vector<InputComponentInfo> input_components_; |
| 941 | 946 |
| 942 // Optional list of commands (keyboard shortcuts). | 947 // Optional list of commands (keyboard shortcuts). |
| 943 scoped_ptr<extensions::Command> browser_action_command_; | 948 scoped_ptr<extensions::Command> browser_action_command_; |
| 944 scoped_ptr<extensions::Command> page_action_command_; | 949 scoped_ptr<extensions::Command> page_action_command_; |
| 945 extensions::CommandMap named_commands_; | 950 extensions::CommandMap named_commands_; |
| 946 | 951 |
| 947 // Optional list of web accessible extension resources. | 952 // Optional list of web accessible extension resources. |
| 948 base::hash_set<std::string> web_accessible_resources_; | 953 base::hash_set<std::string> web_accessible_resources_; |
| 949 | 954 |
| 955 // Optional list of web extension resources that are sandboxed (served from |
| 956 // a unique origin). |
| 957 base::hash_set<std::string> sandboxed_resources_; |
| 958 |
| 950 // Optional URL to a master page of which a single instance should be always | 959 // Optional URL to a master page of which a single instance should be always |
| 951 // loaded in the background. | 960 // loaded in the background. |
| 952 GURL background_url_; | 961 GURL background_url_; |
| 953 | 962 |
| 954 // Optional list of scripts to use to generate a background page. If this is | 963 // Optional list of scripts to use to generate a background page. If this is |
| 955 // present, background_url_ will be empty and generated by GetBackgroundURL(). | 964 // present, background_url_ will be empty and generated by GetBackgroundURL(). |
| 956 std::vector<std::string> background_scripts_; | 965 std::vector<std::string> background_scripts_; |
| 957 | 966 |
| 958 // True if the background page should stay loaded forever; false if it should | 967 // True if the background page should stay loaded forever; false if it should |
| 959 // load on-demand (when it needs to handle an event). Defaults to true. | 968 // load on-demand (when it needs to handle an event). Defaults to true. |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1114 | 1123 |
| 1115 UpdatedExtensionPermissionsInfo( | 1124 UpdatedExtensionPermissionsInfo( |
| 1116 const Extension* extension, | 1125 const Extension* extension, |
| 1117 const ExtensionPermissionSet* permissions, | 1126 const ExtensionPermissionSet* permissions, |
| 1118 Reason reason); | 1127 Reason reason); |
| 1119 }; | 1128 }; |
| 1120 | 1129 |
| 1121 } // namespace extensions | 1130 } // namespace extensions |
| 1122 | 1131 |
| 1123 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 1132 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
| OLD | NEW |