| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 // several factors. | 118 // several factors. |
| 119 typedef std::map<std::string, string16> SimplePermissions; | 119 typedef std::map<std::string, string16> SimplePermissions; |
| 120 static const SimplePermissions& GetSimplePermissions(); | 120 static const SimplePermissions& GetSimplePermissions(); |
| 121 | 121 |
| 122 // An NPAPI plugin included in the extension. | 122 // An NPAPI plugin included in the extension. |
| 123 struct PluginInfo { | 123 struct PluginInfo { |
| 124 FilePath path; // Path to the plugin. | 124 FilePath path; // Path to the plugin. |
| 125 bool is_public; // False if only this extension can load this plugin. | 125 bool is_public; // False if only this extension can load this plugin. |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 // A toolstrip and its associated mole. | |
| 129 struct ToolstripInfo { | |
| 130 ToolstripInfo() : mole_height(0) {} | |
| 131 | |
| 132 GURL toolstrip; | |
| 133 GURL mole; | |
| 134 int mole_height; | |
| 135 }; | |
| 136 | |
| 137 // The name of the manifest inside an extension. | 128 // The name of the manifest inside an extension. |
| 138 static const FilePath::CharType kManifestFilename[]; | 129 static const FilePath::CharType kManifestFilename[]; |
| 139 | 130 |
| 140 // The name of locale folder inside an extension. | 131 // The name of locale folder inside an extension. |
| 141 static const FilePath::CharType kLocaleFolder[]; | 132 static const FilePath::CharType kLocaleFolder[]; |
| 142 | 133 |
| 143 // The name of the messages file inside an extension. | 134 // The name of the messages file inside an extension. |
| 144 static const FilePath::CharType kMessagesFilename[]; | 135 static const FilePath::CharType kMessagesFilename[]; |
| 145 | 136 |
| 146 #if defined(OS_WIN) | 137 #if defined(OS_WIN) |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 bool converted_from_user_script() const { | 249 bool converted_from_user_script() const { |
| 259 return converted_from_user_script_; | 250 return converted_from_user_script_; |
| 260 } | 251 } |
| 261 const UserScriptList& content_scripts() const { return content_scripts_; } | 252 const UserScriptList& content_scripts() const { return content_scripts_; } |
| 262 ExtensionAction* page_action() const { return page_action_.get(); } | 253 ExtensionAction* page_action() const { return page_action_.get(); } |
| 263 ExtensionAction* browser_action() const { return browser_action_.get(); } | 254 ExtensionAction* browser_action() const { return browser_action_.get(); } |
| 264 const std::vector<PluginInfo>& plugins() const { return plugins_; } | 255 const std::vector<PluginInfo>& plugins() const { return plugins_; } |
| 265 const GURL& background_url() const { return background_url_; } | 256 const GURL& background_url() const { return background_url_; } |
| 266 const GURL& options_url() const { return options_url_; } | 257 const GURL& options_url() const { return options_url_; } |
| 267 const GURL& devtools_url() const { return devtools_url_; } | 258 const GURL& devtools_url() const { return devtools_url_; } |
| 268 const std::vector<ToolstripInfo>& toolstrips() const { return toolstrips_; } | 259 const std::vector<GURL>& toolstrips() const { return toolstrips_; } |
| 269 const std::vector<std::string>& api_permissions() const { | 260 const std::vector<std::string>& api_permissions() const { |
| 270 return api_permissions_; | 261 return api_permissions_; |
| 271 } | 262 } |
| 272 const URLPatternList& host_permissions() const { | 263 const URLPatternList& host_permissions() const { |
| 273 return host_permissions_; | 264 return host_permissions_; |
| 274 } | 265 } |
| 275 | 266 |
| 276 // Returns true if the extension has the specified API permission. | 267 // Returns true if the extension has the specified API permission. |
| 277 bool HasApiPermission(const std::string& permission) const { | 268 bool HasApiPermission(const std::string& permission) const { |
| 278 return std::find(api_permissions_.begin(), api_permissions_.end(), | 269 return std::find(api_permissions_.begin(), api_permissions_.end(), |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 // loaded in the background. | 478 // loaded in the background. |
| 488 GURL background_url_; | 479 GURL background_url_; |
| 489 | 480 |
| 490 // Optional URL to a page for setting options/preferences. | 481 // Optional URL to a page for setting options/preferences. |
| 491 GURL options_url_; | 482 GURL options_url_; |
| 492 | 483 |
| 493 // Optional URL to a devtools extension page. | 484 // Optional URL to a devtools extension page. |
| 494 GURL devtools_url_; | 485 GURL devtools_url_; |
| 495 | 486 |
| 496 // Optional list of toolstrips_ and associated properties. | 487 // Optional list of toolstrips_ and associated properties. |
| 497 std::vector<ToolstripInfo> toolstrips_; | 488 std::vector<GURL> toolstrips_; |
| 498 | 489 |
| 499 // The public key ('key' in the manifest) used to sign the contents of the | 490 // The public key ('key' in the manifest) used to sign the contents of the |
| 500 // crx package ('signature' in the manifest) | 491 // crx package ('signature' in the manifest) |
| 501 std::string public_key_; | 492 std::string public_key_; |
| 502 | 493 |
| 503 // A map of resource id's to relative file paths. | 494 // A map of resource id's to relative file paths. |
| 504 scoped_ptr<DictionaryValue> theme_images_; | 495 scoped_ptr<DictionaryValue> theme_images_; |
| 505 | 496 |
| 506 // A map of color names to colors. | 497 // A map of color names to colors. |
| 507 scoped_ptr<DictionaryValue> theme_colors_; | 498 scoped_ptr<DictionaryValue> theme_colors_; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 scoped_ptr<DictionaryValue> extension_manifest; | 600 scoped_ptr<DictionaryValue> extension_manifest; |
| 610 std::string extension_id; | 601 std::string extension_id; |
| 611 FilePath extension_path; | 602 FilePath extension_path; |
| 612 Extension::Location extension_location; | 603 Extension::Location extension_location; |
| 613 | 604 |
| 614 private: | 605 private: |
| 615 DISALLOW_COPY_AND_ASSIGN(ExtensionInfo); | 606 DISALLOW_COPY_AND_ASSIGN(ExtensionInfo); |
| 616 }; | 607 }; |
| 617 | 608 |
| 618 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 609 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
| OLD | NEW |