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