| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 // Icon sizes used by the extension system. | 48 // Icon sizes used by the extension system. |
| 49 static const int kKnownIconSizes[]; | 49 static const int kKnownIconSizes[]; |
| 50 | 50 |
| 51 // An NPAPI plugin included in the extension. | 51 // An NPAPI plugin included in the extension. |
| 52 struct PluginInfo { | 52 struct PluginInfo { |
| 53 FilePath path; // Path to the plugin. | 53 FilePath path; // Path to the plugin. |
| 54 bool is_public; // False if only this extension can load this plugin. | 54 bool is_public; // False if only this extension can load this plugin. |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 // A toolstrip and its associated mole. |
| 58 struct ToolstripInfo { |
| 59 ToolstripInfo() : mole_height(0) {} |
| 60 |
| 61 GURL toolstrip; |
| 62 GURL mole; |
| 63 int mole_height; |
| 64 }; |
| 65 |
| 57 // The name of the manifest inside an extension. | 66 // The name of the manifest inside an extension. |
| 58 static const char kManifestFilename[]; | 67 static const char kManifestFilename[]; |
| 59 | 68 |
| 60 #if defined(OS_WIN) | 69 #if defined(OS_WIN) |
| 61 static const char* kExtensionRegistryPath; | 70 static const char* kExtensionRegistryPath; |
| 62 #endif | 71 #endif |
| 63 | 72 |
| 64 // The number of bytes in a legal id. | 73 // The number of bytes in a legal id. |
| 65 static const size_t kIdSize; | 74 static const size_t kIdSize; |
| 66 | 75 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 const Version* version() const { return version_.get(); } | 149 const Version* version() const { return version_.get(); } |
| 141 // String representation of the version number. | 150 // String representation of the version number. |
| 142 const std::string VersionString() const; | 151 const std::string VersionString() const; |
| 143 const std::string& name() const { return name_; } | 152 const std::string& name() const { return name_; } |
| 144 const std::string& public_key() const { return public_key_; } | 153 const std::string& public_key() const { return public_key_; } |
| 145 const std::string& description() const { return description_; } | 154 const std::string& description() const { return description_; } |
| 146 const UserScriptList& content_scripts() const { return content_scripts_; } | 155 const UserScriptList& content_scripts() const { return content_scripts_; } |
| 147 const PageActionMap& page_actions() const { return page_actions_; } | 156 const PageActionMap& page_actions() const { return page_actions_; } |
| 148 const std::vector<PluginInfo>& plugins() const { return plugins_; } | 157 const std::vector<PluginInfo>& plugins() const { return plugins_; } |
| 149 const GURL& background_url() const { return background_url_; } | 158 const GURL& background_url() const { return background_url_; } |
| 150 const std::vector<std::string>& toolstrips() const { return toolstrips_; } | 159 const std::vector<ToolstripInfo>& toolstrips() const { return toolstrips_; } |
| 151 const std::vector<URLPattern>& permissions() const { return permissions_; } | 160 const std::vector<URLPattern>& permissions() const { return permissions_; } |
| 152 const GURL& update_url() const { return update_url_; } | 161 const GURL& update_url() const { return update_url_; } |
| 153 const std::map<int, std::string>& icons() { return icons_; } | 162 const std::map<int, std::string>& icons() { return icons_; } |
| 154 | 163 |
| 155 // Retrieves a page action by |id|. | 164 // Retrieves a page action by |id|. |
| 156 const PageAction* GetPageAction(std::string id) const; | 165 const PageAction* GetPageAction(std::string id) const; |
| 157 | 166 |
| 158 // Returns the origin of this extension. This function takes a |registry_path| | 167 // Returns the origin of this extension. This function takes a |registry_path| |
| 159 // so that the registry location can be overwritten during testing. | 168 // so that the registry location can be overwritten during testing. |
| 160 Location ExternalExtensionInstallType(std::string registry_path); | 169 Location ExternalExtensionInstallType(std::string registry_path); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 // A list of page actions. | 239 // A list of page actions. |
| 231 PageActionMap page_actions_; | 240 PageActionMap page_actions_; |
| 232 | 241 |
| 233 // Optional list of NPAPI plugins and associated properties. | 242 // Optional list of NPAPI plugins and associated properties. |
| 234 std::vector<PluginInfo> plugins_; | 243 std::vector<PluginInfo> plugins_; |
| 235 | 244 |
| 236 // Optional URL to a master page of which a single instance should be always | 245 // Optional URL to a master page of which a single instance should be always |
| 237 // loaded in the background. | 246 // loaded in the background. |
| 238 GURL background_url_; | 247 GURL background_url_; |
| 239 | 248 |
| 240 // Paths to HTML files to be displayed in the toolbar. | 249 // Optional list of toolstrips_ and associated properties. |
| 241 std::vector<std::string> toolstrips_; | 250 std::vector<ToolstripInfo> toolstrips_; |
| 242 | 251 |
| 243 // The public key ('key' in the manifest) used to sign the contents of the | 252 // The public key ('key' in the manifest) used to sign the contents of the |
| 244 // crx package ('signature' in the manifest) | 253 // crx package ('signature' in the manifest) |
| 245 std::string public_key_; | 254 std::string public_key_; |
| 246 | 255 |
| 247 // A map of resource id's to relative file paths. | 256 // A map of resource id's to relative file paths. |
| 248 scoped_ptr<DictionaryValue> theme_images_; | 257 scoped_ptr<DictionaryValue> theme_images_; |
| 249 | 258 |
| 250 // A map of color names to colors. | 259 // A map of color names to colors. |
| 251 scoped_ptr<DictionaryValue> theme_colors_; | 260 scoped_ptr<DictionaryValue> theme_colors_; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 267 | 276 |
| 268 // URL for fetching an update manifest | 277 // URL for fetching an update manifest |
| 269 GURL update_url_; | 278 GURL update_url_; |
| 270 | 279 |
| 271 FRIEND_TEST(ExtensionTest, LoadPageActionHelper); | 280 FRIEND_TEST(ExtensionTest, LoadPageActionHelper); |
| 272 | 281 |
| 273 DISALLOW_COPY_AND_ASSIGN(Extension); | 282 DISALLOW_COPY_AND_ASSIGN(Extension); |
| 274 }; | 283 }; |
| 275 | 284 |
| 276 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 285 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
| OLD | NEW |