Chromium Code Reviews| Index: extensions/renderer/user_script_set.h |
| diff --git a/extensions/renderer/user_script_set.h b/extensions/renderer/user_script_set.h |
| index 48fc641298eb4ca99cfc4d4af6269e0d6661c72f..ded019fad2bb6a9f71cee5faa94c40f51cf02384 100644 |
| --- a/extensions/renderer/user_script_set.h |
| +++ b/extensions/renderer/user_script_set.h |
| @@ -31,7 +31,7 @@ class ScriptInjection; |
| // The UserScriptSet is a collection of UserScripts which knows how to update |
| // itself from SharedMemory and create ScriptInjections for UserScripts to |
| // inject on a page. |
| -class UserScriptSet : public content::RenderProcessObserver { |
| +class UserScriptSet { |
| public: |
| class Observer { |
| public: |
| @@ -40,13 +40,15 @@ class UserScriptSet : public content::RenderProcessObserver { |
| const std::vector<UserScript*>& scripts) = 0; |
| }; |
| - UserScriptSet(const ExtensionSet* extensions); |
| + explicit UserScriptSet(const ExtensionSet* extensions); |
| virtual ~UserScriptSet(); |
| // Adds or removes observers. |
| void AddObserver(Observer* observer); |
| void RemoveObserver(Observer* observer); |
| + const std::vector<UserScript*>& scripts() const { return scripts_.get(); } |
|
Devlin
2014/07/29 17:11:57
nit: accessor should go last (just above "private:
Mark Dittmer
2014/07/29 22:01:13
Done.
|
| + |
| // Appends the ids of the extensions that have user scripts to |ids|. |
| void GetActiveExtensionIds(std::set<std::string>* ids) const; |
| @@ -59,14 +61,13 @@ class UserScriptSet : public content::RenderProcessObserver { |
| int tab_id, |
| UserScript::RunLocation run_location); |
| - private: |
| - // content::RenderProcessObserver implementation. |
| - virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE; |
| - |
| - // Handle the UpdateUserScripts extension message. |
| - void OnUpdateUserScripts(base::SharedMemoryHandle shared_memory, |
| + // Handle the UpdateUserScripts extension message. Return true if the |
|
Devlin
2014/07/29 17:11:57
This is kinda lying - it doesn't really handle the
Mark Dittmer
2014/07/29 22:01:13
Done.
|
| + // method follows through on notifying observers of the change, or false if |
| + // an error occurred. |
| + bool OnUpdateUserScripts(base::SharedMemoryHandle shared_memory, |
| const std::set<std::string>& changed_extensions); |
| + private: |
| // Update the parsed scripts from |shared memory|. |
| bool UpdateScripts(base::SharedMemoryHandle shared_memory); |