| 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/api/extension_action/action_info.h" | 23 #include "chrome/common/extensions/api/extension_action/action_info.h" |
| 24 #include "chrome/common/extensions/command.h" | |
| 25 #include "chrome/common/extensions/extension_constants.h" | 24 #include "chrome/common/extensions/extension_constants.h" |
| 26 #include "chrome/common/extensions/extension_icon_set.h" | 25 #include "chrome/common/extensions/extension_icon_set.h" |
| 27 #include "chrome/common/extensions/permissions/api_permission.h" | 26 #include "chrome/common/extensions/permissions/api_permission.h" |
| 28 #include "chrome/common/extensions/permissions/api_permission_set.h" | 27 #include "chrome/common/extensions/permissions/api_permission_set.h" |
| 29 #include "chrome/common/extensions/permissions/permission_message.h" | 28 #include "chrome/common/extensions/permissions/permission_message.h" |
| 30 #include "chrome/common/extensions/user_script.h" | 29 #include "chrome/common/extensions/user_script.h" |
| 31 #include "extensions/common/url_pattern.h" | 30 #include "extensions/common/url_pattern.h" |
| 32 #include "extensions/common/url_pattern_set.h" | 31 #include "extensions/common/url_pattern_set.h" |
| 33 #include "googleurl/src/gurl.h" | 32 #include "googleurl/src/gurl.h" |
| 34 #include "ui/base/accelerators/accelerator.h" | 33 #include "ui/base/accelerators/accelerator.h" |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 const ActionInfo* system_indicator_info() const { | 674 const ActionInfo* system_indicator_info() const { |
| 676 return system_indicator_info_.get(); | 675 return system_indicator_info_.get(); |
| 677 } | 676 } |
| 678 const std::vector<PluginInfo>& plugins() const { return plugins_; } | 677 const std::vector<PluginInfo>& plugins() const { return plugins_; } |
| 679 const std::vector<NaClModuleInfo>& nacl_modules() const { | 678 const std::vector<NaClModuleInfo>& nacl_modules() const { |
| 680 return nacl_modules_; | 679 return nacl_modules_; |
| 681 } | 680 } |
| 682 const std::vector<InputComponentInfo>& input_components() const { | 681 const std::vector<InputComponentInfo>& input_components() const { |
| 683 return input_components_; | 682 return input_components_; |
| 684 } | 683 } |
| 685 // The browser action command that the extension wants to use, which is not | |
| 686 // necessarily the one it can use, as it might be inactive (see also | |
| 687 // GetBrowserActionCommand in CommandService). | |
| 688 const extensions::Command* browser_action_command() const { | |
| 689 return browser_action_command_.get(); | |
| 690 } | |
| 691 // The page action command that the extension wants to use, which is not | |
| 692 // necessarily the one it can use, as it might be inactive (see also | |
| 693 // GetPageActionCommand in CommandService). | |
| 694 const extensions::Command* page_action_command() const { | |
| 695 return page_action_command_.get(); | |
| 696 } | |
| 697 // The script badge command that the extension wants to use, which is not | |
| 698 // necessarily the one it can use, as it might be inactive (see also | |
| 699 // GetScriptBadgeCommand in CommandService). | |
| 700 const extensions::Command* script_badge_command() const { | |
| 701 return script_badge_command_.get(); | |
| 702 } | |
| 703 // The map (of command names to commands) that the extension wants to use, | |
| 704 // which is not necessarily the one it can use, as they might be inactive | |
| 705 // (see also GetNamedCommands in CommandService). | |
| 706 const extensions::CommandMap& named_commands() const { | |
| 707 return named_commands_; | |
| 708 } | |
| 709 bool has_background_page() const { | 684 bool has_background_page() const { |
| 710 return background_url_.is_valid() || !background_scripts_.empty(); | 685 return background_url_.is_valid() || !background_scripts_.empty(); |
| 711 } | 686 } |
| 712 bool allow_background_js_access() const { | 687 bool allow_background_js_access() const { |
| 713 return allow_background_js_access_; | 688 return allow_background_js_access_; |
| 714 } | 689 } |
| 715 const std::vector<std::string>& background_scripts() const { | 690 const std::vector<std::string>& background_scripts() const { |
| 716 return background_scripts_; | 691 return background_scripts_; |
| 717 } | 692 } |
| 718 bool has_persistent_background_page() const { | 693 bool has_persistent_background_page() const { |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 bool LoadLaunchContainer(string16* error); | 856 bool LoadLaunchContainer(string16* error); |
| 882 bool LoadLaunchURL(string16* error); | 857 bool LoadLaunchURL(string16* error); |
| 883 | 858 |
| 884 bool LoadSharedFeatures(const APIPermissionSet& api_permissions, | 859 bool LoadSharedFeatures(const APIPermissionSet& api_permissions, |
| 885 string16* error); | 860 string16* error); |
| 886 bool LoadDescription(string16* error); | 861 bool LoadDescription(string16* error); |
| 887 bool LoadManifestVersion(string16* error); | 862 bool LoadManifestVersion(string16* error); |
| 888 bool LoadHomepageURL(string16* error); | 863 bool LoadHomepageURL(string16* error); |
| 889 bool LoadUpdateURL(string16* error); | 864 bool LoadUpdateURL(string16* error); |
| 890 bool LoadIcons(string16* error); | 865 bool LoadIcons(string16* error); |
| 891 bool LoadCommands(string16* error); | |
| 892 bool LoadPlugins(string16* error); | 866 bool LoadPlugins(string16* error); |
| 893 bool LoadNaClModules(string16* error); | 867 bool LoadNaClModules(string16* error); |
| 894 bool LoadWebAccessibleResources(string16* error); | 868 bool LoadWebAccessibleResources(string16* error); |
| 895 bool LoadSandboxedPages(string16* error); | 869 bool LoadSandboxedPages(string16* error); |
| 896 // Must be called after LoadPlugins(). | 870 // Must be called after LoadPlugins(). |
| 897 bool LoadRequirements(string16* error); | 871 bool LoadRequirements(string16* error); |
| 898 bool LoadDefaultLocale(string16* error); | 872 bool LoadDefaultLocale(string16* error); |
| 899 bool LoadOfflineEnabled(string16* error); | 873 bool LoadOfflineEnabled(string16* error); |
| 900 bool LoadOptionsPage(string16* error); | 874 bool LoadOptionsPage(string16* error); |
| 901 bool LoadBackgroundScripts(string16* error); | 875 bool LoadBackgroundScripts(string16* error); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1079 | 1053 |
| 1080 // Optional list of NPAPI plugins and associated properties. | 1054 // Optional list of NPAPI plugins and associated properties. |
| 1081 std::vector<PluginInfo> plugins_; | 1055 std::vector<PluginInfo> plugins_; |
| 1082 | 1056 |
| 1083 // Optional list of NaCl modules and associated properties. | 1057 // Optional list of NaCl modules and associated properties. |
| 1084 std::vector<NaClModuleInfo> nacl_modules_; | 1058 std::vector<NaClModuleInfo> nacl_modules_; |
| 1085 | 1059 |
| 1086 // Optional list of input components and associated properties. | 1060 // Optional list of input components and associated properties. |
| 1087 std::vector<InputComponentInfo> input_components_; | 1061 std::vector<InputComponentInfo> input_components_; |
| 1088 | 1062 |
| 1089 // Optional list of commands (keyboard shortcuts). | |
| 1090 scoped_ptr<extensions::Command> browser_action_command_; | |
| 1091 scoped_ptr<extensions::Command> page_action_command_; | |
| 1092 scoped_ptr<extensions::Command> script_badge_command_; | |
| 1093 extensions::CommandMap named_commands_; | |
| 1094 | |
| 1095 // Optional list of web accessible extension resources. | 1063 // Optional list of web accessible extension resources. |
| 1096 URLPatternSet web_accessible_resources_; | 1064 URLPatternSet web_accessible_resources_; |
| 1097 | 1065 |
| 1098 // Optional list of extension pages that are sandboxed (served from a unique | 1066 // Optional list of extension pages that are sandboxed (served from a unique |
| 1099 // origin with a different Content Security Policy). | 1067 // origin with a different Content Security Policy). |
| 1100 URLPatternSet sandboxed_pages_; | 1068 URLPatternSet sandboxed_pages_; |
| 1101 | 1069 |
| 1102 // Content Security Policy that should be used to enforce the sandbox used | 1070 // Content Security Policy that should be used to enforce the sandbox used |
| 1103 // by sandboxed pages (guaranteed to have the "sandbox" directive without the | 1071 // by sandboxed pages (guaranteed to have the "sandbox" directive without the |
| 1104 // "allow-same-origin" token). | 1072 // "allow-same-origin" token). |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1282 | 1250 |
| 1283 UpdatedExtensionPermissionsInfo( | 1251 UpdatedExtensionPermissionsInfo( |
| 1284 const Extension* extension, | 1252 const Extension* extension, |
| 1285 const PermissionSet* permissions, | 1253 const PermissionSet* permissions, |
| 1286 Reason reason); | 1254 Reason reason); |
| 1287 }; | 1255 }; |
| 1288 | 1256 |
| 1289 } // namespace extensions | 1257 } // namespace extensions |
| 1290 | 1258 |
| 1291 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 1259 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
| OLD | NEW |