| 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 "base/threading/thread_checker.h" |
| 23 #include "chrome/common/extensions/api/extension_action/action_info.h" | 24 #include "chrome/common/extensions/api/extension_action/action_info.h" |
| 24 #include "chrome/common/extensions/command.h" | 25 #include "chrome/common/extensions/command.h" |
| 25 #include "chrome/common/extensions/extension_constants.h" | 26 #include "chrome/common/extensions/extension_constants.h" |
| 26 #include "chrome/common/extensions/extension_icon_set.h" | 27 #include "chrome/common/extensions/extension_icon_set.h" |
| 27 #include "chrome/common/extensions/permissions/api_permission.h" | 28 #include "chrome/common/extensions/permissions/api_permission.h" |
| 28 #include "chrome/common/extensions/permissions/api_permission_set.h" | 29 #include "chrome/common/extensions/permissions/api_permission_set.h" |
| 29 #include "chrome/common/extensions/permissions/permission_message.h" | 30 #include "chrome/common/extensions/permissions/permission_message.h" |
| 30 #include "chrome/common/extensions/user_script.h" | 31 #include "chrome/common/extensions/user_script.h" |
| 31 #include "extensions/common/url_pattern.h" | 32 #include "extensions/common/url_pattern.h" |
| 32 #include "extensions/common/url_pattern_set.h" | 33 #include "extensions/common/url_pattern_set.h" |
| (...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 // In pseudocode, returns | 663 // In pseudocode, returns |
| 663 // base::Base64Encode(RSAPrivateKey(pem_file).ExportPublicKey()). | 664 // base::Base64Encode(RSAPrivateKey(pem_file).ExportPublicKey()). |
| 664 const std::string& public_key() const { return public_key_; } | 665 const std::string& public_key() const { return public_key_; } |
| 665 const std::string& description() const { return description_; } | 666 const std::string& description() const { return description_; } |
| 666 int manifest_version() const { return manifest_version_; } | 667 int manifest_version() const { return manifest_version_; } |
| 667 bool converted_from_user_script() const { | 668 bool converted_from_user_script() const { |
| 668 return converted_from_user_script_; | 669 return converted_from_user_script_; |
| 669 } | 670 } |
| 670 const UserScriptList& content_scripts() const { return content_scripts_; } | 671 const UserScriptList& content_scripts() const { return content_scripts_; } |
| 671 const ActionInfo* page_action_info() const { return page_action_info_.get(); } | 672 const ActionInfo* page_action_info() const { return page_action_info_.get(); } |
| 672 const ActionInfo* browser_action_info() const { | |
| 673 return browser_action_info_.get(); | |
| 674 } | |
| 675 const ActionInfo* system_indicator_info() const { | 673 const ActionInfo* system_indicator_info() const { |
| 676 return system_indicator_info_.get(); | 674 return system_indicator_info_.get(); |
| 677 } | 675 } |
| 678 const std::vector<PluginInfo>& plugins() const { return plugins_; } | 676 const std::vector<PluginInfo>& plugins() const { return plugins_; } |
| 679 const std::vector<NaClModuleInfo>& nacl_modules() const { | 677 const std::vector<NaClModuleInfo>& nacl_modules() const { |
| 680 return nacl_modules_; | 678 return nacl_modules_; |
| 681 } | 679 } |
| 682 const std::vector<InputComponentInfo>& input_components() const { | 680 const std::vector<InputComponentInfo>& input_components() const { |
| 683 return input_components_; | 681 return input_components_; |
| 684 } | 682 } |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1064 // True if the extension was generated from a user script. (We show slightly | 1062 // True if the extension was generated from a user script. (We show slightly |
| 1065 // different UI if so). | 1063 // different UI if so). |
| 1066 bool converted_from_user_script_; | 1064 bool converted_from_user_script_; |
| 1067 | 1065 |
| 1068 // Paths to the content scripts the extension contains. | 1066 // Paths to the content scripts the extension contains. |
| 1069 UserScriptList content_scripts_; | 1067 UserScriptList content_scripts_; |
| 1070 | 1068 |
| 1071 // The extension's page action, if any. | 1069 // The extension's page action, if any. |
| 1072 scoped_ptr<ActionInfo> page_action_info_; | 1070 scoped_ptr<ActionInfo> page_action_info_; |
| 1073 | 1071 |
| 1074 // The extension's browser action, if any. | |
| 1075 scoped_ptr<ActionInfo> browser_action_info_; | |
| 1076 | |
| 1077 // The extension's system indicator, if any. | 1072 // The extension's system indicator, if any. |
| 1078 scoped_ptr<ActionInfo> system_indicator_info_; | 1073 scoped_ptr<ActionInfo> system_indicator_info_; |
| 1079 | 1074 |
| 1080 // Optional list of NPAPI plugins and associated properties. | 1075 // Optional list of NPAPI plugins and associated properties. |
| 1081 std::vector<PluginInfo> plugins_; | 1076 std::vector<PluginInfo> plugins_; |
| 1082 | 1077 |
| 1083 // Optional list of NaCl modules and associated properties. | 1078 // Optional list of NaCl modules and associated properties. |
| 1084 std::vector<NaClModuleInfo> nacl_modules_; | 1079 std::vector<NaClModuleInfo> nacl_modules_; |
| 1085 | 1080 |
| 1086 // Optional list of input components and associated properties. | 1081 // Optional list of input components and associated properties. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1155 | 1150 |
| 1156 // The manifest from which this extension was created. | 1151 // The manifest from which this extension was created. |
| 1157 scoped_ptr<Manifest> manifest_; | 1152 scoped_ptr<Manifest> manifest_; |
| 1158 | 1153 |
| 1159 // Stored parsed manifest data. | 1154 // Stored parsed manifest data. |
| 1160 ManifestDataMap manifest_data_; | 1155 ManifestDataMap manifest_data_; |
| 1161 | 1156 |
| 1162 // Set to true at the end of InitValue when initialization is finished. | 1157 // Set to true at the end of InitValue when initialization is finished. |
| 1163 bool finished_parsing_manifest_; | 1158 bool finished_parsing_manifest_; |
| 1164 | 1159 |
| 1160 // Ensures that any call to GetManifestData() prior to finishing |
| 1161 // initialization happens from the same thread (this can happen when certain |
| 1162 // parts of the initialization process need information from previous parts). |
| 1163 base::ThreadChecker thread_checker_; |
| 1164 |
| 1165 // A map of chrome:// hostnames (newtab, downloads, etc.) to Extension URLs | 1165 // A map of chrome:// hostnames (newtab, downloads, etc.) to Extension URLs |
| 1166 // which override the handling of those URLs. (see ExtensionOverrideUI). | 1166 // which override the handling of those URLs. (see ExtensionOverrideUI). |
| 1167 URLOverrideMap chrome_url_overrides_; | 1167 URLOverrideMap chrome_url_overrides_; |
| 1168 | 1168 |
| 1169 // Whether this extension requests isolated storage. | 1169 // Whether this extension requests isolated storage. |
| 1170 bool is_storage_isolated_; | 1170 bool is_storage_isolated_; |
| 1171 | 1171 |
| 1172 // The local path inside the extension to use with the launcher. | 1172 // The local path inside the extension to use with the launcher. |
| 1173 std::string launch_local_path_; | 1173 std::string launch_local_path_; |
| 1174 | 1174 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1282 | 1282 |
| 1283 UpdatedExtensionPermissionsInfo( | 1283 UpdatedExtensionPermissionsInfo( |
| 1284 const Extension* extension, | 1284 const Extension* extension, |
| 1285 const PermissionSet* permissions, | 1285 const PermissionSet* permissions, |
| 1286 Reason reason); | 1286 Reason reason); |
| 1287 }; | 1287 }; |
| 1288 | 1288 |
| 1289 } // namespace extensions | 1289 } // namespace extensions |
| 1290 | 1290 |
| 1291 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 1291 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
| OLD | NEW |