| 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_PROGRAMMATIC_SCRIPT_INJECTOR_H_ | 5 #ifndef EXTENSIONS_RENDERER_PROGRAMMATIC_SCRIPT_INJECTOR_H_ |
| 6 #define EXTENSIONS_RENDERER_PROGRAMMATIC_SCRIPT_INJECTOR_H_ | 6 #define EXTENSIONS_RENDERER_PROGRAMMATIC_SCRIPT_INJECTOR_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "extensions/renderer/script_injection.h" | 10 #include "extensions/renderer/script_injection.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 bool ShouldInjectCss(UserScript::RunLocation run_location) const override; | 40 bool ShouldInjectCss(UserScript::RunLocation run_location) const override; |
| 41 PermissionsData::AccessType CanExecuteOnFrame( | 41 PermissionsData::AccessType CanExecuteOnFrame( |
| 42 const InjectionHost* injection_host, | 42 const InjectionHost* injection_host, |
| 43 blink::WebFrame* web_frame, | 43 blink::WebFrame* web_frame, |
| 44 int tab_id, | 44 int tab_id, |
| 45 const GURL& top_url) const override; | 45 const GURL& top_url) const override; |
| 46 std::vector<blink::WebScriptSource> GetJsSources( | 46 std::vector<blink::WebScriptSource> GetJsSources( |
| 47 UserScript::RunLocation run_location) const override; | 47 UserScript::RunLocation run_location) const override; |
| 48 std::vector<std::string> GetCssSources( | 48 std::vector<std::string> GetCssSources( |
| 49 UserScript::RunLocation run_location) const override; | 49 UserScript::RunLocation run_location) const override; |
| 50 void GetRunInfo(ScriptsRunInfo* scripts_run_info, |
| 51 UserScript::RunLocation run_location) const override; |
| 50 void OnInjectionComplete(scoped_ptr<base::ListValue> execution_results, | 52 void OnInjectionComplete(scoped_ptr<base::ListValue> execution_results, |
| 51 ScriptsRunInfo* scripts_run_info, | |
| 52 UserScript::RunLocation run_location) override; | 53 UserScript::RunLocation run_location) override; |
| 53 void OnWillNotInject(InjectFailureReason reason) override; | 54 void OnWillNotInject(InjectFailureReason reason) override; |
| 54 | 55 |
| 55 // Return the run location for this injector. | 56 // Return the run location for this injector. |
| 56 UserScript::RunLocation GetRunLocation() const; | 57 UserScript::RunLocation GetRunLocation() const; |
| 57 | 58 |
| 58 // Notify the browser that the script was injected (or never will be), and | 59 // Notify the browser that the script was injected (or never will be), and |
| 59 // send along any results or errors. | 60 // send along any results or errors. |
| 60 void Finish(const std::string& error); | 61 void Finish(const std::string& error); |
| 61 | 62 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 73 | 74 |
| 74 // Whether or not this script injection has finished. | 75 // Whether or not this script injection has finished. |
| 75 bool finished_; | 76 bool finished_; |
| 76 | 77 |
| 77 DISALLOW_COPY_AND_ASSIGN(ProgrammaticScriptInjector); | 78 DISALLOW_COPY_AND_ASSIGN(ProgrammaticScriptInjector); |
| 78 }; | 79 }; |
| 79 | 80 |
| 80 } // namespace extensions | 81 } // namespace extensions |
| 81 | 82 |
| 82 #endif // EXTENSIONS_RENDERER_PROGRAMMATIC_SCRIPT_INJECTOR_H_ | 83 #endif // EXTENSIONS_RENDERER_PROGRAMMATIC_SCRIPT_INJECTOR_H_ |
| OLD | NEW |