| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 // Returns true if the script should execute in child frames. | 43 // Returns true if the script should execute in child frames. |
| 44 virtual bool ShouldExecuteInChildFrames() const = 0; | 44 virtual bool ShouldExecuteInChildFrames() const = 0; |
| 45 | 45 |
| 46 // Returns true if the script should execute in the main world. | 46 // Returns true if the script should execute in the main world. |
| 47 virtual bool ShouldExecuteInMainWorld() const = 0; | 47 virtual bool ShouldExecuteInMainWorld() const = 0; |
| 48 | 48 |
| 49 // Returns true if the script is running inside a user gesture. | 49 // Returns true if the script is running inside a user gesture. |
| 50 virtual bool IsUserGesture() const = 0; | 50 virtual bool IsUserGesture() const = 0; |
| 51 | 51 |
| 52 // Returns ture if the script expects results. | 52 // Returns true if the script expects results. |
| 53 virtual bool ExpectsResults() const = 0; | 53 virtual bool ExpectsResults() const = 0; |
| 54 | 54 |
| 55 // Returns true if the script should inject JS source at the given | 55 // Returns true if the script should inject JS source at the given |
| 56 // |run_location|. | 56 // |run_location|. |
| 57 virtual bool ShouldInjectJs(UserScript::RunLocation run_location) const = 0; | 57 virtual bool ShouldInjectJs(UserScript::RunLocation run_location) const = 0; |
| 58 | 58 |
| 59 // Returns true if the script should inject CSS at the given |run_location|. | 59 // Returns true if the script should inject CSS at the given |run_location|. |
| 60 virtual bool ShouldInjectCss(UserScript::RunLocation run_location) const = 0; | 60 virtual bool ShouldInjectCss(UserScript::RunLocation run_location) const = 0; |
| 61 | 61 |
| 62 // Returns true if the script should execute on the given |frame|. | 62 // Returns true if the script should execute on the given |frame|. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 87 scoped_ptr<base::ListValue> execution_results, | 87 scoped_ptr<base::ListValue> execution_results, |
| 88 UserScript::RunLocation run_location) = 0; | 88 UserScript::RunLocation run_location) = 0; |
| 89 | 89 |
| 90 // Notifies the script that injection will never occur. | 90 // Notifies the script that injection will never occur. |
| 91 virtual void OnWillNotInject(InjectFailureReason reason) = 0; | 91 virtual void OnWillNotInject(InjectFailureReason reason) = 0; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 } // namespace extensions | 94 } // namespace extensions |
| 95 | 95 |
| 96 #endif // EXTENSIONS_RENDERER_SCRIPT_INJECTOR_H_ | 96 #endif // EXTENSIONS_RENDERER_SCRIPT_INJECTOR_H_ |
| OLD | NEW |