Chromium Code Reviews| Index: chrome/common/extensions/extension.h |
| diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h |
| index fd224f2248760fcbf959be6938f53ff62198b36c..c075a2db189c6ab311ccf4ef583392ad53c1b1ca 100644 |
| --- a/chrome/common/extensions/extension.h |
| +++ b/chrome/common/extensions/extension.h |
| @@ -231,11 +231,11 @@ class Extension : public base::RefCountedThreadSafe<Extension> { |
| // In a few special circumstances, we want to create an Extension and give it |
| // an explicit id. Most consumers should just use the other Create() method. |
| static scoped_refptr<Extension> Create(const FilePath& path, |
| - Location location, |
| - const base::DictionaryValue& value, |
| - int flags, |
| - const std::string& explicit_id, |
| - std::string* error); |
| + Location location, |
| + const base::DictionaryValue& value, |
| + int flags, |
| + const std::string& explicit_id, |
| + std::string* error); |
| // Given two install sources, return the one which should take priority |
| // over the other. If an extension is installed from two sources A and B, |
| @@ -368,7 +368,7 @@ class Extension : public base::RefCountedThreadSafe<Extension> { |
| std::string* output, |
| bool is_public); |
| - // Given an extension, icon size and match type, read a valid icon if present |
| + // Given an extension, icon size, and match type, read a valid icon if present |
| // and decode it into result. In the browser process, this will DCHECK if not |
| // called on the file thread. To easily load extension images on the UI |
| // thread, see ImageLoadingTracker. |
| @@ -679,8 +679,59 @@ class Extension : public base::RefCountedThreadSafe<Extension> { |
| // into strong types and discard the value. But doing both is bad. |
| bool InitFromValue(int flags, string16* error); |
| - // Helpers to load various chunks of the manifest. |
| + // The following are helpers for InitFromValue to load various features of the |
| + // extension. |
|
Yoyo Zhou
2012/03/01 01:17:25
...from the manifest
Devlin
2012/03/02 17:31:04
Done.
|
| + |
| + bool LoadSharedFeatures(const int& flags, |
| + string16* error); |
| + bool LoadName(string16* error); |
| + bool LoadDescription(string16* error); |
| + bool LoadVersion(string16* error); |
| + bool LoadMinimumChromeVersion(string16* error); |
| bool LoadManifestVersion(string16* error); |
| + bool LoadPublicKey(const int& flags, |
| + string16* error); |
| + bool LoadHomepageURL(string16* error); |
| + bool LoadUpdateURL(string16* error); |
| + bool LoadExtensionFeatures(const int& flags, |
| + const ExtensionAPIPermissionSet& api_permissions, |
| + string16* error); |
| + bool LoadOptionsPage(string16* error); |
| + bool LoadDevToolsPage(string16* error); |
| + bool LoadInputComponents(const ExtensionAPIPermissionSet& api_permissions, |
| + string16* error); |
| + bool LoadCommands(string16* error); |
| + bool LoadIcons(string16* error); |
| + bool LoadPlugins(string16* error); |
| + bool LoadNaClModules(string16* error); |
| + bool LoadContentScripts(const int& flags, |
| + string16* error); |
| + bool LoadWebAccessibleResources(string16* error); |
| + bool LoadPageAction(string16* error); |
| + bool LoadBrowserAction(string16* error); |
| + bool LoadFileBrowserHandlers(string16* error); |
| + // Helper method to load a FileBrowserHandlerList from the manifest. |
| + FileBrowserHandlerList* LoadFileBrowserHandlersHelper( |
| + const base::ListValue* extension_actions, string16* error); |
| + // Helper method to load an FileBrowserHandler from manifest. |
| + FileBrowserHandler* LoadFileBrowserHandler( |
| + const base::DictionaryValue* file_browser_handlers, string16* error); |
| + bool LoadChromeURLOverrides(string16* error); |
| + bool LoadOmnibox(string16* error); |
| + bool LoadTextToSpeechVoices(string16* error); |
| + bool LoadWebIntentServices(string16* error); |
| + bool LoadRequirements(string16* error); |
| + bool LoadDefaultLocale(string16* error); |
| + bool LoadOfflineEnabled(string16* error); |
| + bool LoadIncognito(string16* error); |
| + bool LoadBackgroundScripts(string16* error); |
| + bool LoadBackgroundPage(const ExtensionAPIPermissionSet& api_permissions, |
| + string16* error); |
| + bool LoadBackgroundPersistent( |
| + const ExtensionAPIPermissionSet& api_permissions, |
| + string16* error); |
| + bool LoadContentSecurityPolicy(string16* error); |
| + bool LoadAppFeatures(string16* error); |
| bool LoadExtent(const char* key, |
| URLPatternSet* extent, |
| const char* list_error, |
| @@ -689,13 +740,21 @@ class Extension : public base::RefCountedThreadSafe<Extension> { |
| bool LoadLaunchContainer(string16* error); |
| bool LoadLaunchURL(string16* error); |
| bool LoadAppIsolation(string16* error); |
| - bool LoadWebIntentServices(string16* error); |
| - bool LoadBackgroundScripts(string16* error); |
| - bool LoadBackgroundPage(const ExtensionAPIPermissionSet& api_permissions, |
| - string16* error); |
| - bool LoadBackgroundPersistent( |
| - const ExtensionAPIPermissionSet& api_permissions, |
| - string16* error); |
| + bool LoadThemeFeatures(string16* error); |
| + bool LoadThemeImages(const base::DictionaryValue* theme_value, |
| + string16* error); |
| + bool LoadThemeColors(const base::DictionaryValue* theme_value, |
| + string16* error); |
| + bool LoadThemeTints(const base::DictionaryValue* theme_value, |
| + string16* error); |
| + bool LoadThemeDisplayProperties(const base::DictionaryValue* theme_value, |
| + string16* error); |
| + |
| + // Helper function for implementing HasCachedImage/GetCachedImage. A return |
| + // value of NULL means there is no matching image cached (we allow caching an |
| + // empty SkBitmap). |
| + SkBitmap* GetCachedImageImpl(const ExtensionResource& source, |
| + const gfx::Size& max_size) const; |
| // Helper method that loads a UserScript object from a |
| // dictionary in the content_script list of the manifest. |
| @@ -719,13 +778,6 @@ class Extension : public base::RefCountedThreadSafe<Extension> { |
| ExtensionAction* LoadExtensionActionHelper( |
| const base::DictionaryValue* extension_action, string16* error); |
| - // Helper method to load an FileBrowserHandlerList from the manifest. |
| - FileBrowserHandlerList* LoadFileBrowserHandlers( |
| - const base::ListValue* extension_actions, string16* error); |
| - // Helper method to load an FileBrowserHandler from manifest. |
| - FileBrowserHandler* LoadFileBrowserHandler( |
| - const base::DictionaryValue* file_browser_handlers, string16* error); |
| - |
| // Returns true if the extension has more than one "UI surface". For example, |
| // an extension that has a browser action and a page action. |
| bool HasMultipleUISurfaces() const; |
| @@ -744,12 +796,6 @@ class Extension : public base::RefCountedThreadSafe<Extension> { |
| bool CanSpecifyHostPermission(const URLPattern& pattern, |
| const ExtensionAPIPermissionSet& permissions) const; |
| - // Helper function for implementing HasCachedImage/GetCachedImage. A return |
| - // value of NULL means there is no matching image cached (we allow caching an |
| - // empty SkBitmap). |
| - SkBitmap* GetCachedImageImpl(const ExtensionResource& source, |
| - const gfx::Size& max_size) const; |
| - |
| // Cached images for this extension. This should only be touched on the UI |
| // thread. |
| mutable ImageCache image_cache_; |
| @@ -877,7 +923,7 @@ class Extension : public base::RefCountedThreadSafe<Extension> { |
| // URL for fetching an update manifest |
| GURL update_url_; |
| - // The manifest that this extension was created from. |
| + // The manifest from which this extension was created. |
| // |
| // NOTE: This is an owned pointer, but can't use scoped_ptr because that would |
| // require manifest.h, which would in turn create a circulate dependency |