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 <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "extensions/common/permissions/permissions_data.h" | 11 #include "extensions/common/permissions/permissions_data.h" |
12 #include "extensions/common/user_script.h" | 12 #include "extensions/common/user_script.h" |
13 #include "third_party/WebKit/public/web/WebScriptSource.h" | 13 #include "third_party/WebKit/public/web/WebScriptSource.h" |
14 | 14 |
15 class GURL; | |
16 class InjectionHost; | 15 class InjectionHost; |
17 | 16 |
18 namespace blink { | 17 namespace blink { |
19 class WebLocalFrame; | 18 class WebLocalFrame; |
20 } | 19 } |
21 | 20 |
22 namespace extensions { | 21 namespace extensions { |
23 struct ScriptsRunInfo; | |
24 | 22 |
25 // The pseudo-delegate class for a ScriptInjection that provides all necessary | 23 // The pseudo-delegate class for a ScriptInjection that provides all necessary |
26 // information about how to inject the script, including what code to inject, | 24 // information about how to inject the script, including what code to inject, |
27 // when (run location), and where (world), but without any injection logic. | 25 // when (run location), and where (world), but without any injection logic. |
28 class ScriptInjector { | 26 class ScriptInjector { |
29 public: | 27 public: |
30 // The possible reasons for not injecting the script. | 28 // The possible reasons for not injecting the script. |
31 enum InjectFailureReason { | 29 enum InjectFailureReason { |
32 EXTENSION_REMOVED, // The extension was removed before injection. | 30 EXTENSION_REMOVED, // The extension was removed before injection. |
33 NOT_ALLOWED, // The script is not allowed to inject. | 31 NOT_ALLOWED, // The script is not allowed to inject. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // Notifies the script that injection will never occur. | 90 // Notifies the script that injection will never occur. |
93 // |render_frame| contains the render frame, or null if the frame was | 91 // |render_frame| contains the render frame, or null if the frame was |
94 // invalidated. | 92 // invalidated. |
95 virtual void OnWillNotInject(InjectFailureReason reason, | 93 virtual void OnWillNotInject(InjectFailureReason reason, |
96 content::RenderFrame* render_frame) = 0; | 94 content::RenderFrame* render_frame) = 0; |
97 }; | 95 }; |
98 | 96 |
99 } // namespace extensions | 97 } // namespace extensions |
100 | 98 |
101 #endif // EXTENSIONS_RENDERER_SCRIPT_INJECTOR_H_ | 99 #endif // EXTENSIONS_RENDERER_SCRIPT_INJECTOR_H_ |
OLD | NEW |