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 22 matching lines...) Expand all Loading... | |
33 NOT_ALLOWED, // The script is not allowed to inject. | 33 NOT_ALLOWED, // The script is not allowed to inject. |
34 WONT_INJECT // The injection won't inject because the user rejected | 34 WONT_INJECT // The injection won't inject because the user rejected |
35 // (or just did not accept) the injection. | 35 // (or just did not accept) the injection. |
36 }; | 36 }; |
37 | 37 |
38 virtual ~ScriptInjector() {} | 38 virtual ~ScriptInjector() {} |
39 | 39 |
40 // Returns the script type of this particular injection. | 40 // Returns the script type of this particular injection. |
41 virtual UserScript::InjectionType script_type() const = 0; | 41 virtual UserScript::InjectionType script_type() const = 0; |
42 | 42 |
43 // Returns true if the injector refers to a declarative content script. | |
44 virtual bool is_declarative() const = 0; | |
Devlin
2014/08/21 17:06:16
Why?
Mark Dittmer
2014/08/23 12:21:39
ditto (comment in programmatic_script_injector.h)
| |
45 | |
43 // Returns true if the script should execute in child frames. | 46 // Returns true if the script should execute in child frames. |
44 virtual bool ShouldExecuteInChildFrames() const = 0; | 47 virtual bool ShouldExecuteInChildFrames() const = 0; |
45 | 48 |
46 // Returns true if the script should execute in the main world. | 49 // Returns true if the script should execute in the main world. |
47 virtual bool ShouldExecuteInMainWorld() const = 0; | 50 virtual bool ShouldExecuteInMainWorld() const = 0; |
48 | 51 |
49 // Returns true if the script is running inside a user gesture. | 52 // Returns true if the script is running inside a user gesture. |
50 virtual bool IsUserGesture() const = 0; | 53 virtual bool IsUserGesture() const = 0; |
51 | 54 |
52 // Returns ture if the script expects results. | 55 // Returns ture if the script expects results. |
(...skipping 30 matching lines...) Expand all Loading... | |
83 ScriptsRunInfo* scripts_run_info, | 86 ScriptsRunInfo* scripts_run_info, |
84 UserScript::RunLocation run_location) = 0; | 87 UserScript::RunLocation run_location) = 0; |
85 | 88 |
86 // Notifies the script that injection will never occur. | 89 // Notifies the script that injection will never occur. |
87 virtual void OnWillNotInject(InjectFailureReason reason) = 0; | 90 virtual void OnWillNotInject(InjectFailureReason reason) = 0; |
88 }; | 91 }; |
89 | 92 |
90 } // namespace extensions | 93 } // namespace extensions |
91 | 94 |
92 #endif // EXTENSIONS_RENDERER_SCRIPT_INJECTOR_H_ | 95 #endif // EXTENSIONS_RENDERER_SCRIPT_INJECTOR_H_ |
OLD | NEW |