| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/common/extensions/extension_permission_set.h" | 23 #include "chrome/common/extensions/extension_permission_set.h" |
| 24 #include "chrome/common/extensions/manifest.h" | 24 #include "chrome/common/extensions/manifest.h" |
| 25 #include "chrome/common/extensions/user_script.h" | 25 #include "chrome/common/extensions/user_script.h" |
| 26 #include "chrome/common/extensions/url_pattern.h" | 26 #include "chrome/common/extensions/url_pattern.h" |
| 27 #include "chrome/common/extensions/url_pattern_set.h" | 27 #include "chrome/common/extensions/url_pattern_set.h" |
| 28 #include "googleurl/src/gurl.h" | 28 #include "googleurl/src/gurl.h" |
| 29 #include "ui/gfx/size.h" | 29 #include "ui/gfx/size.h" |
| 30 | 30 |
| 31 class ExtensionAction; | 31 class ExtensionAction; |
| 32 class ExtensionResource; | 32 class ExtensionResource; |
| 33 class ExtensionSidebarDefaults; | |
| 34 class FileBrowserHandler; | 33 class FileBrowserHandler; |
| 35 class SkBitmap; | 34 class SkBitmap; |
| 36 class Version; | 35 class Version; |
| 37 | 36 |
| 38 namespace base { | 37 namespace base { |
| 39 class DictionaryValue; | 38 class DictionaryValue; |
| 40 class ListValue; | 39 class ListValue; |
| 41 } | 40 } |
| 42 | 41 |
| 43 namespace webkit_glue { | 42 namespace webkit_glue { |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 // over the other. If an extension is installed from two sources A and B, | 224 // over the other. If an extension is installed from two sources A and B, |
| 226 // its install source should be set to GetHigherPriorityLocation(A, B). | 225 // its install source should be set to GetHigherPriorityLocation(A, B). |
| 227 static Location GetHigherPriorityLocation(Location loc1, Location loc2); | 226 static Location GetHigherPriorityLocation(Location loc1, Location loc2); |
| 228 | 227 |
| 229 // Icon sizes used by the extension system. | 228 // Icon sizes used by the extension system. |
| 230 static const int kIconSizes[]; | 229 static const int kIconSizes[]; |
| 231 | 230 |
| 232 // Max size (both dimensions) for browser and page actions. | 231 // Max size (both dimensions) for browser and page actions. |
| 233 static const int kPageActionIconMaxSize; | 232 static const int kPageActionIconMaxSize; |
| 234 static const int kBrowserActionIconMaxSize; | 233 static const int kBrowserActionIconMaxSize; |
| 235 static const int kSidebarIconMaxSize; | |
| 236 | 234 |
| 237 // Valid schemes for web extent URLPatterns. | 235 // Valid schemes for web extent URLPatterns. |
| 238 static const int kValidWebExtentSchemes; | 236 static const int kValidWebExtentSchemes; |
| 239 | 237 |
| 240 // Valid schemes for host permission URLPatterns. | 238 // Valid schemes for host permission URLPatterns. |
| 241 static const int kValidHostPermissionSchemes; | 239 static const int kValidHostPermissionSchemes; |
| 242 | 240 |
| 243 // The name of the manifest inside an extension. | 241 // The name of the manifest inside an extension. |
| 244 static const FilePath::CharType kManifestFilename[]; | 242 static const FilePath::CharType kManifestFilename[]; |
| 245 | 243 |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 const std::string& name() const { return name_; } | 509 const std::string& name() const { return name_; } |
| 512 const std::string& public_key() const { return public_key_; } | 510 const std::string& public_key() const { return public_key_; } |
| 513 const std::string& description() const { return description_; } | 511 const std::string& description() const { return description_; } |
| 514 int manifest_version() const { return manifest_version_; } | 512 int manifest_version() const { return manifest_version_; } |
| 515 bool converted_from_user_script() const { | 513 bool converted_from_user_script() const { |
| 516 return converted_from_user_script_; | 514 return converted_from_user_script_; |
| 517 } | 515 } |
| 518 const UserScriptList& content_scripts() const { return content_scripts_; } | 516 const UserScriptList& content_scripts() const { return content_scripts_; } |
| 519 ExtensionAction* page_action() const { return page_action_.get(); } | 517 ExtensionAction* page_action() const { return page_action_.get(); } |
| 520 ExtensionAction* browser_action() const { return browser_action_.get(); } | 518 ExtensionAction* browser_action() const { return browser_action_.get(); } |
| 521 ExtensionSidebarDefaults* sidebar_defaults() const { | |
| 522 return sidebar_defaults_.get(); | |
| 523 } | |
| 524 const FileBrowserHandlerList* file_browser_handlers() const { | 519 const FileBrowserHandlerList* file_browser_handlers() const { |
| 525 return file_browser_handlers_.get(); | 520 return file_browser_handlers_.get(); |
| 526 } | 521 } |
| 527 const std::vector<PluginInfo>& plugins() const { return plugins_; } | 522 const std::vector<PluginInfo>& plugins() const { return plugins_; } |
| 528 const std::vector<NaClModuleInfo>& nacl_modules() const { | 523 const std::vector<NaClModuleInfo>& nacl_modules() const { |
| 529 return nacl_modules_; | 524 return nacl_modules_; |
| 530 } | 525 } |
| 531 const std::vector<InputComponentInfo>& input_components() const { | 526 const std::vector<InputComponentInfo>& input_components() const { |
| 532 return input_components_; | 527 return input_components_; |
| 533 } | 528 } |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 ExtensionAction* LoadExtensionActionHelper( | 673 ExtensionAction* LoadExtensionActionHelper( |
| 679 const base::DictionaryValue* extension_action, string16* error); | 674 const base::DictionaryValue* extension_action, string16* error); |
| 680 | 675 |
| 681 // Helper method to load an FileBrowserHandlerList from the manifest. | 676 // Helper method to load an FileBrowserHandlerList from the manifest. |
| 682 FileBrowserHandlerList* LoadFileBrowserHandlers( | 677 FileBrowserHandlerList* LoadFileBrowserHandlers( |
| 683 const base::ListValue* extension_actions, string16* error); | 678 const base::ListValue* extension_actions, string16* error); |
| 684 // Helper method to load an FileBrowserHandler from manifest. | 679 // Helper method to load an FileBrowserHandler from manifest. |
| 685 FileBrowserHandler* LoadFileBrowserHandler( | 680 FileBrowserHandler* LoadFileBrowserHandler( |
| 686 const base::DictionaryValue* file_browser_handlers, string16* error); | 681 const base::DictionaryValue* file_browser_handlers, string16* error); |
| 687 | 682 |
| 688 // Helper method to load an ExtensionSidebarDefaults from the sidebar manifest | |
| 689 // entry. | |
| 690 ExtensionSidebarDefaults* LoadExtensionSidebarDefaults( | |
| 691 const base::DictionaryValue* sidebar, string16* error); | |
| 692 | |
| 693 // Returns true if the extension has more than one "UI surface". For example, | 683 // Returns true if the extension has more than one "UI surface". For example, |
| 694 // an extension that has a browser action and a page action. | 684 // an extension that has a browser action and a page action. |
| 695 bool HasMultipleUISurfaces() const; | 685 bool HasMultipleUISurfaces() const; |
| 696 | 686 |
| 697 // Updates the launch URL and extents for the extension using the given | 687 // Updates the launch URL and extents for the extension using the given |
| 698 // |override_url|. | 688 // |override_url|. |
| 699 void OverrideLaunchUrl(const GURL& override_url); | 689 void OverrideLaunchUrl(const GURL& override_url); |
| 700 | 690 |
| 701 // Returns true if this extension can specify |api|. | 691 // Returns true if this extension can specify |api|. |
| 702 bool CanSpecifyAPIPermission(const ExtensionAPIPermission* api, | 692 bool CanSpecifyAPIPermission(const ExtensionAPIPermission* api, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 | 773 |
| 784 // The extension's page action, if any. | 774 // The extension's page action, if any. |
| 785 scoped_ptr<ExtensionAction> page_action_; | 775 scoped_ptr<ExtensionAction> page_action_; |
| 786 | 776 |
| 787 // The extension's browser action, if any. | 777 // The extension's browser action, if any. |
| 788 scoped_ptr<ExtensionAction> browser_action_; | 778 scoped_ptr<ExtensionAction> browser_action_; |
| 789 | 779 |
| 790 // The extension's file browser actions, if any. | 780 // The extension's file browser actions, if any. |
| 791 scoped_ptr<FileBrowserHandlerList> file_browser_handlers_; | 781 scoped_ptr<FileBrowserHandlerList> file_browser_handlers_; |
| 792 | 782 |
| 793 // The extension's sidebar, if any. | |
| 794 scoped_ptr<ExtensionSidebarDefaults> sidebar_defaults_; | |
| 795 | |
| 796 // Optional list of NPAPI plugins and associated properties. | 783 // Optional list of NPAPI plugins and associated properties. |
| 797 std::vector<PluginInfo> plugins_; | 784 std::vector<PluginInfo> plugins_; |
| 798 | 785 |
| 799 // Optional list of NaCl modules and associated properties. | 786 // Optional list of NaCl modules and associated properties. |
| 800 std::vector<NaClModuleInfo> nacl_modules_; | 787 std::vector<NaClModuleInfo> nacl_modules_; |
| 801 | 788 |
| 802 // Optional list of input components and associated properties. | 789 // Optional list of input components and associated properties. |
| 803 std::vector<InputComponentInfo> input_components_; | 790 std::vector<InputComponentInfo> input_components_; |
| 804 | 791 |
| 805 // Optional list of web accessible extension resources. | 792 // Optional list of web accessible extension resources. |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 // only contain the removed permissions. | 934 // only contain the removed permissions. |
| 948 const ExtensionPermissionSet* permissions; | 935 const ExtensionPermissionSet* permissions; |
| 949 | 936 |
| 950 UpdatedExtensionPermissionsInfo( | 937 UpdatedExtensionPermissionsInfo( |
| 951 const Extension* extension, | 938 const Extension* extension, |
| 952 const ExtensionPermissionSet* permissions, | 939 const ExtensionPermissionSet* permissions, |
| 953 Reason reason); | 940 Reason reason); |
| 954 }; | 941 }; |
| 955 | 942 |
| 956 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 943 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
| OLD | NEW |