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

Unified Diff: content/renderer/devtools/devtools_client.cc

Issue 1144393004: [DevTools] Load DevTools frontend without iframe (chromium part). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-test
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
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()));

Powered by Google App Engine
This is Rietveld 408576698