Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: extensions/renderer/script_injection.h

Issue 922403002: [Extensions] Adjust script injection reporting to the browser side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « extensions/renderer/injection_host.h ('k') | extensions/renderer/script_injection.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_INJECTION_H_ 5 #ifndef EXTENSIONS_RENDERER_SCRIPT_INJECTION_H_
6 #define EXTENSIONS_RENDERER_SCRIPT_INJECTION_H_ 6 #define EXTENSIONS_RENDERER_SCRIPT_INJECTION_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "extensions/common/user_script.h" 10 #include "extensions/common/user_script.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // Returns true if the injection ran. 50 // Returns true if the injection ran.
51 bool OnPermissionGranted(const InjectionHost* injection_host, 51 bool OnPermissionGranted(const InjectionHost* injection_host,
52 ScriptsRunInfo* scripts_run_info); 52 ScriptsRunInfo* scripts_run_info);
53 53
54 // Accessors. 54 // Accessors.
55 blink::WebLocalFrame* web_frame() const { return web_frame_; } 55 blink::WebLocalFrame* web_frame() const { return web_frame_; }
56 const HostID& host_id() const { return host_id_; } 56 const HostID& host_id() const { return host_id_; }
57 int64 request_id() const { return request_id_; } 57 int64 request_id() const { return request_id_; }
58 58
59 private: 59 private:
60 // Send a message to the browser requesting permission to execute. 60 // Sends a message to the browser, either that the script injection would
61 void RequestPermission(); 61 // like to inject, or to notify the browser that it is currently injecting.
62 void SendInjectionMessage(bool request_permission);
62 63
63 // Injects the script, optionally populating |scripts_run_info|. 64 // Injects the script, optionally populating |scripts_run_info|.
64 void Inject(const InjectionHost* injection_host, 65 void Inject(const InjectionHost* injection_host,
65 ScriptsRunInfo* scripts_run_info); 66 ScriptsRunInfo* scripts_run_info);
66 67
67 // Inject any JS scripts into the |frame|, optionally populating 68 // Inject any JS scripts into the |frame|, optionally populating
68 // |execution_results|. 69 // |execution_results|.
69 void InjectJs(const InjectionHost* injection_host, 70 void InjectJs(const InjectionHost* injection_host,
70 blink::WebLocalFrame* frame, 71 blink::WebLocalFrame* frame,
71 base::ListValue* execution_results); 72 base::ListValue* execution_results);
(...skipping 26 matching lines...) Expand all
98 // Whether or not the injection is complete, either via injecting the script 99 // Whether or not the injection is complete, either via injecting the script
99 // or because it will never complete. 100 // or because it will never complete.
100 bool complete_; 101 bool complete_;
101 102
102 DISALLOW_COPY_AND_ASSIGN(ScriptInjection); 103 DISALLOW_COPY_AND_ASSIGN(ScriptInjection);
103 }; 104 };
104 105
105 } // namespace extensions 106 } // namespace extensions
106 107
107 #endif // EXTENSIONS_RENDERER_SCRIPT_INJECTION_H_ 108 #endif // EXTENSIONS_RENDERER_SCRIPT_INJECTION_H_
OLDNEW
« no previous file with comments | « extensions/renderer/injection_host.h ('k') | extensions/renderer/script_injection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698