| OLD | NEW | 
|    1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |    1 // Copyright (c) 2011 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 11 matching lines...) Expand all  Loading... | 
|   22 #include "chrome/common/extensions/extension_permission_set.h" |   22 #include "chrome/common/extensions/extension_permission_set.h" | 
|   23 #include "chrome/common/extensions/manifest.h" |   23 #include "chrome/common/extensions/manifest.h" | 
|   24 #include "chrome/common/extensions/user_script.h" |   24 #include "chrome/common/extensions/user_script.h" | 
|   25 #include "chrome/common/extensions/url_pattern.h" |   25 #include "chrome/common/extensions/url_pattern.h" | 
|   26 #include "chrome/common/extensions/url_pattern_set.h" |   26 #include "chrome/common/extensions/url_pattern_set.h" | 
|   27 #include "googleurl/src/gurl.h" |   27 #include "googleurl/src/gurl.h" | 
|   28 #include "ui/gfx/size.h" |   28 #include "ui/gfx/size.h" | 
|   29  |   29  | 
|   30 class ExtensionAction; |   30 class ExtensionAction; | 
|   31 class ExtensionResource; |   31 class ExtensionResource; | 
|   32 class ExtensionSidebarDefaults; |  | 
|   33 class FileBrowserHandler; |   32 class FileBrowserHandler; | 
|   34 class SkBitmap; |   33 class SkBitmap; | 
|   35 class Version; |   34 class Version; | 
|   36  |   35  | 
|   37 namespace base { |   36 namespace base { | 
|   38 class DictionaryValue; |   37 class DictionaryValue; | 
|   39 class ListValue; |   38 class ListValue; | 
|   40 } |   39 } | 
|   41  |   40  | 
|   42 namespace webkit_glue { |   41 namespace webkit_glue { | 
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  224   // over the other. If an extension is installed from two sources A and B, |  223   // over the other. If an extension is installed from two sources A and B, | 
|  225   // its install source should be set to GetHigherPriorityLocation(A, B). |  224   // its install source should be set to GetHigherPriorityLocation(A, B). | 
|  226   static Location GetHigherPriorityLocation(Location loc1, Location loc2); |  225   static Location GetHigherPriorityLocation(Location loc1, Location loc2); | 
|  227  |  226  | 
|  228   // Icon sizes used by the extension system. |  227   // Icon sizes used by the extension system. | 
|  229   static const int kIconSizes[]; |  228   static const int kIconSizes[]; | 
|  230  |  229  | 
|  231   // Max size (both dimensions) for browser and page actions. |  230   // Max size (both dimensions) for browser and page actions. | 
|  232   static const int kPageActionIconMaxSize; |  231   static const int kPageActionIconMaxSize; | 
|  233   static const int kBrowserActionIconMaxSize; |  232   static const int kBrowserActionIconMaxSize; | 
|  234   static const int kSidebarIconMaxSize; |  | 
|  235  |  233  | 
|  236   // Valid schemes for web extent URLPatterns. |  234   // Valid schemes for web extent URLPatterns. | 
|  237   static const int kValidWebExtentSchemes; |  235   static const int kValidWebExtentSchemes; | 
|  238  |  236  | 
|  239   // Valid schemes for host permission URLPatterns. |  237   // Valid schemes for host permission URLPatterns. | 
|  240   static const int kValidHostPermissionSchemes; |  238   static const int kValidHostPermissionSchemes; | 
|  241  |  239  | 
|  242   // The name of the manifest inside an extension. |  240   // The name of the manifest inside an extension. | 
|  243   static const FilePath::CharType kManifestFilename[]; |  241   static const FilePath::CharType kManifestFilename[]; | 
|  244  |  242  | 
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  504   const std::string& name() const { return name_; } |  502   const std::string& name() const { return name_; } | 
|  505   const std::string& public_key() const { return public_key_; } |  503   const std::string& public_key() const { return public_key_; } | 
|  506   const std::string& description() const { return description_; } |  504   const std::string& description() const { return description_; } | 
|  507   int manifest_version() const { return manifest_version_; } |  505   int manifest_version() const { return manifest_version_; } | 
|  508   bool converted_from_user_script() const { |  506   bool converted_from_user_script() const { | 
|  509     return converted_from_user_script_; |  507     return converted_from_user_script_; | 
|  510   } |  508   } | 
|  511   const UserScriptList& content_scripts() const { return content_scripts_; } |  509   const UserScriptList& content_scripts() const { return content_scripts_; } | 
|  512   ExtensionAction* page_action() const { return page_action_.get(); } |  510   ExtensionAction* page_action() const { return page_action_.get(); } | 
|  513   ExtensionAction* browser_action() const { return browser_action_.get(); } |  511   ExtensionAction* browser_action() const { return browser_action_.get(); } | 
|  514   ExtensionSidebarDefaults* sidebar_defaults() const { |  | 
|  515     return sidebar_defaults_.get(); |  | 
|  516   } |  | 
|  517   const FileBrowserHandlerList* file_browser_handlers() const { |  512   const FileBrowserHandlerList* file_browser_handlers() const { | 
|  518     return file_browser_handlers_.get(); |  513     return file_browser_handlers_.get(); | 
|  519   } |  514   } | 
|  520   const std::vector<PluginInfo>& plugins() const { return plugins_; } |  515   const std::vector<PluginInfo>& plugins() const { return plugins_; } | 
|  521   const std::vector<NaClModuleInfo>& nacl_modules() const { |  516   const std::vector<NaClModuleInfo>& nacl_modules() const { | 
|  522     return nacl_modules_; |  517     return nacl_modules_; | 
|  523   } |  518   } | 
|  524   const std::vector<InputComponentInfo>& input_components() const { |  519   const std::vector<InputComponentInfo>& input_components() const { | 
|  525     return input_components_; |  520     return input_components_; | 
|  526   } |  521   } | 
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  668   ExtensionAction* LoadExtensionActionHelper( |  663   ExtensionAction* LoadExtensionActionHelper( | 
|  669       const base::DictionaryValue* extension_action, string16* error); |  664       const base::DictionaryValue* extension_action, string16* error); | 
|  670  |  665  | 
|  671   // Helper method to load an FileBrowserHandlerList from the manifest. |  666   // Helper method to load an FileBrowserHandlerList from the manifest. | 
|  672   FileBrowserHandlerList* LoadFileBrowserHandlers( |  667   FileBrowserHandlerList* LoadFileBrowserHandlers( | 
|  673       const base::ListValue* extension_actions, string16* error); |  668       const base::ListValue* extension_actions, string16* error); | 
|  674   // Helper method to load an FileBrowserHandler from manifest. |  669   // Helper method to load an FileBrowserHandler from manifest. | 
|  675   FileBrowserHandler* LoadFileBrowserHandler( |  670   FileBrowserHandler* LoadFileBrowserHandler( | 
|  676       const base::DictionaryValue* file_browser_handlers, string16* error); |  671       const base::DictionaryValue* file_browser_handlers, string16* error); | 
|  677  |  672  | 
|  678   // Helper method to load an ExtensionSidebarDefaults from the sidebar manifest |  | 
|  679   // entry. |  | 
|  680   ExtensionSidebarDefaults* LoadExtensionSidebarDefaults( |  | 
|  681       const base::DictionaryValue* sidebar, string16* error); |  | 
|  682  |  | 
|  683   // Returns true if the extension has more than one "UI surface". For example, |  673   // Returns true if the extension has more than one "UI surface". For example, | 
|  684   // an extension that has a browser action and a page action. |  674   // an extension that has a browser action and a page action. | 
|  685   bool HasMultipleUISurfaces() const; |  675   bool HasMultipleUISurfaces() const; | 
|  686  |  676  | 
|  687   // Updates the launch URL and extents for the extension using the given |  677   // Updates the launch URL and extents for the extension using the given | 
|  688   // |override_url|. |  678   // |override_url|. | 
|  689   void OverrideLaunchUrl(const GURL& override_url); |  679   void OverrideLaunchUrl(const GURL& override_url); | 
|  690  |  680  | 
|  691   // Returns true if this extension can specify |api|. |  681   // Returns true if this extension can specify |api|. | 
|  692   bool CanSpecifyAPIPermission(const ExtensionAPIPermission* api, |  682   bool CanSpecifyAPIPermission(const ExtensionAPIPermission* api, | 
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  773  |  763  | 
|  774   // The extension's page action, if any. |  764   // The extension's page action, if any. | 
|  775   scoped_ptr<ExtensionAction> page_action_; |  765   scoped_ptr<ExtensionAction> page_action_; | 
|  776  |  766  | 
|  777   // The extension's browser action, if any. |  767   // The extension's browser action, if any. | 
|  778   scoped_ptr<ExtensionAction> browser_action_; |  768   scoped_ptr<ExtensionAction> browser_action_; | 
|  779  |  769  | 
|  780   // The extension's file browser actions, if any. |  770   // The extension's file browser actions, if any. | 
|  781   scoped_ptr<FileBrowserHandlerList> file_browser_handlers_; |  771   scoped_ptr<FileBrowserHandlerList> file_browser_handlers_; | 
|  782  |  772  | 
|  783   // The extension's sidebar, if any. |  | 
|  784   scoped_ptr<ExtensionSidebarDefaults> sidebar_defaults_; |  | 
|  785  |  | 
|  786   // Optional list of NPAPI plugins and associated properties. |  773   // Optional list of NPAPI plugins and associated properties. | 
|  787   std::vector<PluginInfo> plugins_; |  774   std::vector<PluginInfo> plugins_; | 
|  788  |  775  | 
|  789   // Optional list of NaCl modules and associated properties. |  776   // Optional list of NaCl modules and associated properties. | 
|  790   std::vector<NaClModuleInfo> nacl_modules_; |  777   std::vector<NaClModuleInfo> nacl_modules_; | 
|  791  |  778  | 
|  792   // Optional list of input components and associated properties. |  779   // Optional list of input components and associated properties. | 
|  793   std::vector<InputComponentInfo> input_components_; |  780   std::vector<InputComponentInfo> input_components_; | 
|  794  |  781  | 
|  795   // Optional URL to a master page of which a single instance should be always |  782   // Optional URL to a master page of which a single instance should be always | 
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  934   // only contain the removed permissions. |  921   // only contain the removed permissions. | 
|  935   const ExtensionPermissionSet* permissions; |  922   const ExtensionPermissionSet* permissions; | 
|  936  |  923  | 
|  937   UpdatedExtensionPermissionsInfo( |  924   UpdatedExtensionPermissionsInfo( | 
|  938       const Extension* extension, |  925       const Extension* extension, | 
|  939       const ExtensionPermissionSet* permissions, |  926       const ExtensionPermissionSet* permissions, | 
|  940       Reason reason); |  927       Reason reason); | 
|  941 }; |  928 }; | 
|  942  |  929  | 
|  943 #endif  // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |  930 #endif  // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 
| OLD | NEW |