Index: content/renderer/devtools/devtools_client.cc |
diff --git a/content/renderer/devtools/devtools_client.cc b/content/renderer/devtools/devtools_client.cc |
index 39bd12a60f4dd1eb855f2a83c9deb799b6e3382d..e649d5ea48e7c4f4e212406f18d522b39bae27f8 100644 |
--- a/content/renderer/devtools/devtools_client.cc |
+++ b/content/renderer/devtools/devtools_client.cc |
@@ -22,8 +22,11 @@ using blink::WebString; |
namespace content { |
-DevToolsClient::DevToolsClient(RenderFrame* main_render_frame) |
- : RenderFrameObserver(main_render_frame) { |
+DevToolsClient::DevToolsClient( |
+ RenderFrame* main_render_frame, |
+ const std::string& injected_script) |
+ : RenderFrameObserver(main_render_frame), |
+ injected_script_(injected_script) { |
const base::CommandLine& command_line = |
*base::CommandLine::ForCurrentProcess(); |
web_tools_frontend_.reset(WebDevToolsFrontend::create( |
@@ -34,6 +37,11 @@ DevToolsClient::DevToolsClient(RenderFrame* main_render_frame) |
DevToolsClient::~DevToolsClient() { |
} |
+void DevToolsClient::DidClearWindowObject() { |
+ if (!injected_script_.empty()) |
+ render_frame()->ExecuteJavaScript(base::UTF8ToUTF16(injected_script_)); |
+} |
+ |
void DevToolsClient::sendMessageToBackend(const WebString& message) { |
Send(new DevToolsAgentMsg_DispatchOnInspectorBackend(routing_id(), |
message.utf8())); |