| 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_USER_SCRIPT_INJECTOR_H_ | 5 #ifndef EXTENSIONS_RENDERER_USER_SCRIPT_INJECTOR_H_ |
| 6 #define EXTENSIONS_RENDERER_USER_SCRIPT_INJECTOR_H_ | 6 #define EXTENSIONS_RENDERER_USER_SCRIPT_INJECTOR_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 private: | 34 private: |
| 35 // UserScriptSet::Observer implementation. | 35 // UserScriptSet::Observer implementation. |
| 36 void OnUserScriptsUpdated(const std::set<HostID>& changed_hosts, | 36 void OnUserScriptsUpdated(const std::set<HostID>& changed_hosts, |
| 37 const UserScriptList& scripts) override; | 37 const UserScriptList& scripts) override; |
| 38 | 38 |
| 39 // ScriptInjector implementation. | 39 // ScriptInjector implementation. |
| 40 UserScript::InjectionType script_type() const override; | 40 UserScript::InjectionType script_type() const override; |
| 41 bool ShouldExecuteInMainWorld() const override; | 41 bool ShouldExecuteInMainWorld() const override; |
| 42 bool IsUserGesture() const override; | 42 bool IsUserGesture() const override; |
| 43 bool ExpectsResults() const override; | 43 bool ExpectsResults() const override; |
| 44 bool ShouldInjectJs(UserScript::RunLocation run_location) const override; | 44 bool ShouldInjectScripts(const UserScript::FileList& scripts, |
| 45 bool ShouldInjectCss(UserScript::RunLocation run_location) const override; | 45 const std::set<GURL>& injected_scripts) const; |
| 46 bool ShouldInjectJs(UserScript::RunLocation run_location, |
| 47 const std::set<GURL>& injected_scripts) const override; |
| 48 bool ShouldInjectCss(UserScript::RunLocation run_location, |
| 49 const std::set<GURL>& injected_scripts) const override; |
| 46 PermissionsData::AccessType CanExecuteOnFrame( | 50 PermissionsData::AccessType CanExecuteOnFrame( |
| 47 const InjectionHost* injection_host, | 51 const InjectionHost* injection_host, |
| 48 blink::WebLocalFrame* web_frame, | 52 blink::WebLocalFrame* web_frame, |
| 49 int tab_id) const override; | 53 int tab_id) const override; |
| 50 std::vector<blink::WebScriptSource> GetJsSources( | 54 std::vector<blink::WebScriptSource> GetJsSources( |
| 51 UserScript::RunLocation run_location) const override; | 55 UserScript::RunLocation run_location, |
| 56 std::set<GURL>& injected_scripts) const override; |
| 52 std::vector<blink::WebString> GetCssSources( | 57 std::vector<blink::WebString> GetCssSources( |
| 53 UserScript::RunLocation run_location) const override; | 58 UserScript::RunLocation run_location, |
| 59 std::set<GURL>& injected_scripts) const override; |
| 54 void GetRunInfo(ScriptsRunInfo* scripts_run_info, | 60 void GetRunInfo(ScriptsRunInfo* scripts_run_info, |
| 55 UserScript::RunLocation run_location) const override; | 61 UserScript::RunLocation run_location, |
| 62 bool js_injection_completed, |
| 63 bool should_inject_css) const override; |
| 56 void OnInjectionComplete(std::unique_ptr<base::Value> execution_result, | 64 void OnInjectionComplete(std::unique_ptr<base::Value> execution_result, |
| 57 UserScript::RunLocation run_location, | 65 UserScript::RunLocation run_location, |
| 58 content::RenderFrame* render_frame) override; | 66 content::RenderFrame* render_frame) override; |
| 59 void OnWillNotInject(InjectFailureReason reason, | 67 void OnWillNotInject(InjectFailureReason reason, |
| 60 content::RenderFrame* render_frame) override; | 68 content::RenderFrame* render_frame) override; |
| 61 | 69 |
| 62 // The associated user script. Owned by the UserScriptInjector that created | 70 // The associated user script. Owned by the UserScriptInjector that created |
| 63 // this object. | 71 // this object. |
| 64 const UserScript* script_; | 72 const UserScript* script_; |
| 65 | 73 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 77 | 85 |
| 78 ScopedObserver<UserScriptSet, UserScriptSet::Observer> | 86 ScopedObserver<UserScriptSet, UserScriptSet::Observer> |
| 79 user_script_set_observer_; | 87 user_script_set_observer_; |
| 80 | 88 |
| 81 DISALLOW_COPY_AND_ASSIGN(UserScriptInjector); | 89 DISALLOW_COPY_AND_ASSIGN(UserScriptInjector); |
| 82 }; | 90 }; |
| 83 | 91 |
| 84 } // namespace extensions | 92 } // namespace extensions |
| 85 | 93 |
| 86 #endif // EXTENSIONS_RENDERER_USER_SCRIPT_INJECTOR_H_ | 94 #endif // EXTENSIONS_RENDERER_USER_SCRIPT_INJECTOR_H_ |
| OLD | NEW |