Chromium Code Reviews| Index: chrome/browser/extensions/component_loader.h |
| diff --git a/chrome/browser/extensions/component_loader.h b/chrome/browser/extensions/component_loader.h |
| index e7b5613d43c1920f92912064d32fda41b5264f51..01dcf6812765f768b309f7bec6b4aa0826370ce5 100644 |
| --- a/chrome/browser/extensions/component_loader.h |
| +++ b/chrome/browser/extensions/component_loader.h |
| @@ -33,22 +33,24 @@ class ComponentLoader : public content::NotificationObserver { |
| return component_extensions_.size(); |
| } |
| + const Extension* GetScriptBubble() const; |
| + |
| // Loads any registered component extensions. |
| void LoadAll(); |
| // Registers and possibly loads a component extension. If ExtensionService |
| // has been initialized, the extension is loaded; otherwise, the load is |
| // deferred until LoadAll is called. |
|
Yoyo Zhou
2012/10/02 01:21:01
Should have a note about what it's returning.
Aaron Boodman
2012/10/02 01:42:22
Done with last patchset.
|
| - const Extension* Add(const std::string& manifest_contents, |
| - const FilePath& root_directory); |
| + std::string Add(const std::string& manifest_contents, |
|
Jeffrey Yasskin
2012/10/02 00:26:31
Comment the meaning of the returned string, please
Aaron Boodman
2012/10/02 01:28:52
Done.
Aaron Boodman
2012/10/02 01:28:52
Done.
|
| + const FilePath& root_directory); |
| // Convenience method for registering a component extension by resource id. |
| - const Extension* Add(int manifest_resource_id, |
| - const FilePath& root_directory); |
| + std::string Add(int manifest_resource_id, |
| + const FilePath& root_directory); |
| // Loads a component extension from file system. Replaces previously added |
| // extension with the same ID. |
| - const Extension* AddOrReplace(const FilePath& path); |
| + std::string AddOrReplace(const FilePath& path); |
| // Returns true if an extension with the specified id has been added. |
| bool Exists(const std::string& id) const; |
| @@ -85,24 +87,26 @@ class ComponentLoader : public content::NotificationObserver { |
| // Reloads a registered component extension. |
| void Reload(const std::string& extension_id); |
| + void AddScriptBubble(); |
|
Jeffrey Yasskin
2012/10/02 00:26:31
Comment what this function does, and possibly how
Yoyo Zhou
2012/10/02 01:21:01
This should be private.
Aaron Boodman
2012/10/02 01:28:52
Done.
Aaron Boodman
2012/10/02 01:42:22
It's called by the unit tests. This is necessary b
|
| + |
| private: |
| // Information about a registered component extension. |
| struct ComponentExtensionInfo { |
| ComponentExtensionInfo(const DictionaryValue* manifest, |
| - const FilePath& root_directory) |
| - : manifest(manifest), |
| - root_directory(root_directory) { |
| - } |
| + const FilePath& root_directory); |
| // The parsed contents of the extensions's manifest file. |
| const DictionaryValue* manifest; |
| // Directory where the extension is stored. |
| FilePath root_directory; |
| + |
| + // The component extension's ID. |
| + std::string id; |
|
Jeffrey Yasskin
2012/10/02 00:26:31
optional: I'd prefer "extension_id" here since it'
Aaron Boodman
2012/10/02 01:28:52
Done.
|
| }; |
| - const Extension* Add(const DictionaryValue* parsed_manifest, |
| - const FilePath& root_directory); |
| + std::string Add(const DictionaryValue* parsed_manifest, |
| + const FilePath& root_directory); |
| // Loads a registered component extension. |
| const Extension* Load(const ComponentExtensionInfo& info); |
| @@ -118,9 +122,6 @@ class ComponentLoader : public content::NotificationObserver { |
| void AddChromeApp(); |
| - // Determine the extension id. |
| - static std::string GenerateId(const base::DictionaryValue* manifest); |
| - |
| PrefService* prefs_; |
| PrefService* local_state_; |
| @@ -132,6 +133,8 @@ class ComponentLoader : public content::NotificationObserver { |
| PrefChangeRegistrar pref_change_registrar_; |
| + std::string script_bubble_id_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(ComponentLoader); |
| }; |