| 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_INJECTOR_H_ | 5 #ifndef EXTENSIONS_RENDERER_SCRIPT_INJECTOR_H_ |
| 6 #define EXTENSIONS_RENDERER_SCRIPT_INJECTOR_H_ | 6 #define EXTENSIONS_RENDERER_SCRIPT_INJECTOR_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // Returns the javascript sources to inject at the given |run_location|. | 69 // Returns the javascript sources to inject at the given |run_location|. |
| 70 // Only called if ShouldInjectJs() is true. | 70 // Only called if ShouldInjectJs() is true. |
| 71 virtual std::vector<blink::WebScriptSource> GetJsSources( | 71 virtual std::vector<blink::WebScriptSource> GetJsSources( |
| 72 UserScript::RunLocation run_location) const = 0; | 72 UserScript::RunLocation run_location) const = 0; |
| 73 | 73 |
| 74 // Returns the css to inject at the given |run_location|. | 74 // Returns the css to inject at the given |run_location|. |
| 75 // Only called if ShouldInjectCss() is true. | 75 // Only called if ShouldInjectCss() is true. |
| 76 virtual std::vector<std::string> GetCssSources( | 76 virtual std::vector<std::string> GetCssSources( |
| 77 UserScript::RunLocation run_location) const = 0; | 77 UserScript::RunLocation run_location) const = 0; |
| 78 | 78 |
| 79 // Fill scriptrs run info based on information about injection. |
| 80 virtual void GetRunInfo( |
| 81 ScriptsRunInfo* scripts_run_info, |
| 82 UserScript::RunLocation run_location) const = 0; |
| 83 |
| 79 // Notifies the script that injection has completed, with a possibly-populated | 84 // Notifies the script that injection has completed, with a possibly-populated |
| 80 // list of results (depending on whether or not ExpectsResults() was true). | 85 // list of results (depending on whether or not ExpectsResults() was true). |
| 81 virtual void OnInjectionComplete( | 86 virtual void OnInjectionComplete( |
| 82 scoped_ptr<base::ListValue> execution_results, | 87 scoped_ptr<base::ListValue> execution_results, |
| 83 ScriptsRunInfo* scripts_run_info, | |
| 84 UserScript::RunLocation run_location) = 0; | 88 UserScript::RunLocation run_location) = 0; |
| 85 | 89 |
| 86 // Notifies the script that injection will never occur. | 90 // Notifies the script that injection will never occur. |
| 87 virtual void OnWillNotInject(InjectFailureReason reason) = 0; | 91 virtual void OnWillNotInject(InjectFailureReason reason) = 0; |
| 88 }; | 92 }; |
| 89 | 93 |
| 90 } // namespace extensions | 94 } // namespace extensions |
| 91 | 95 |
| 92 #endif // EXTENSIONS_RENDERER_SCRIPT_INJECTOR_H_ | 96 #endif // EXTENSIONS_RENDERER_SCRIPT_INJECTOR_H_ |
| OLD | NEW |