| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 EXTENSIONS_RENDERER_SCRIPT_INJECTION_MANAGER_H_ | 5 #ifndef EXTENSIONS_RENDERER_SCRIPT_INJECTION_MANAGER_H_ |
| 6 #define EXTENSIONS_RENDERER_SCRIPT_INJECTION_MANAGER_H_ | 6 #define EXTENSIONS_RENDERER_SCRIPT_INJECTION_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // load point, and injecting them when ready. | 38 // load point, and injecting them when ready. |
| 39 class ScriptInjectionManager : public UserScriptSetManager::Observer { | 39 class ScriptInjectionManager : public UserScriptSetManager::Observer { |
| 40 public: | 40 public: |
| 41 ScriptInjectionManager(const ExtensionSet* extensions, | 41 ScriptInjectionManager(const ExtensionSet* extensions, |
| 42 UserScriptSetManager* user_script_set_manager); | 42 UserScriptSetManager* user_script_set_manager); |
| 43 virtual ~ScriptInjectionManager(); | 43 virtual ~ScriptInjectionManager(); |
| 44 | 44 |
| 45 // Notifies that a new render view has been created. | 45 // Notifies that a new render view has been created. |
| 46 void OnRenderViewCreated(content::RenderView* render_view); | 46 void OnRenderViewCreated(content::RenderView* render_view); |
| 47 | 47 |
| 48 // Removes pending injections of the unloaded extension. |
| 49 void OnExtensionUnloaded(const std::string& extension_id); |
| 50 |
| 48 private: | 51 private: |
| 49 // A RenderViewObserver implementation which watches the various render views | 52 // A RenderViewObserver implementation which watches the various render views |
| 50 // in order to notify the ScriptInjectionManager of different document load | 53 // in order to notify the ScriptInjectionManager of different document load |
| 51 // states. | 54 // states. |
| 52 class RVOHelper; | 55 class RVOHelper; |
| 53 | 56 |
| 54 typedef std::map<blink::WebFrame*, UserScript::RunLocation> FrameStatusMap; | 57 typedef std::map<blink::WebFrame*, UserScript::RunLocation> FrameStatusMap; |
| 55 | 58 |
| 56 // UserScriptSetManager::Observer implementation. | 59 // UserScriptSetManager::Observer implementation. |
| 57 void OnUserScriptsUpdated(const std::set<std::string>& changed_extensions, | 60 void OnUserScriptsUpdated(const std::set<std::string>& changed_extensions, |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 117 |
| 115 ScopedObserver<UserScriptSetManager, UserScriptSetManager::Observer> | 118 ScopedObserver<UserScriptSetManager, UserScriptSetManager::Observer> |
| 116 user_script_set_manager_observer_; | 119 user_script_set_manager_observer_; |
| 117 | 120 |
| 118 DISALLOW_COPY_AND_ASSIGN(ScriptInjectionManager); | 121 DISALLOW_COPY_AND_ASSIGN(ScriptInjectionManager); |
| 119 }; | 122 }; |
| 120 | 123 |
| 121 } // namespace extensions | 124 } // namespace extensions |
| 122 | 125 |
| 123 #endif // EXTENSIONS_RENDERER_SCRIPT_INJECTION_MANAGER_H_ | 126 #endif // EXTENSIONS_RENDERER_SCRIPT_INJECTION_MANAGER_H_ |
| OLD | NEW |