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

Unified Diff: components/html_viewer/html_document.cc

Issue 1163953002: html_viewer: Add DevToolsAgentImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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: components/html_viewer/html_document.cc
diff --git a/components/html_viewer/html_document.cc b/components/html_viewer/html_document.cc
index 4f678954e1683bd86c7e6c070b814e99e598b4de..d16f86baf63e50619a940d1d2aaf05244d710677 100644
--- a/components/html_viewer/html_document.cc
+++ b/components/html_viewer/html_document.cc
@@ -14,6 +14,7 @@
#include "base/thread_task_runner_handle.h"
#include "components/html_viewer/blink_input_events_type_converters.h"
#include "components/html_viewer/blink_url_request_type_converters.h"
+#include "components/html_viewer/devtools_agent_impl.h"
#include "components/html_viewer/media_factory.h"
#include "components/html_viewer/setup.h"
#include "components/html_viewer/web_layer_tree_view_impl.h"
@@ -164,8 +165,12 @@ void HTMLDocument::Load(URLResponsePtr response) {
touch_handler_.reset(new TouchHandler(web_view_));
web_layer_tree_view_impl_->set_widget(web_view_);
ConfigureSettings(web_view_->settings());
- web_view_->setMainFrame(
- blink::WebLocalFrame::create(blink::WebTreeScopeType::Document, this));
+
+ blink::WebLocalFrame* main_frame =
+ blink::WebLocalFrame::create(blink::WebTreeScopeType::Document, this);
+ web_view_->setMainFrame(main_frame);
+
+ devtools_agent_.reset(new DevToolsAgentImpl(main_frame, shell_.get()));
sky 2015/06/02 23:28:32 Why do we always create devtools agent? Shouldn't
yzshen1 2015/06/05 17:29:29 This |devtools_agent_| registers itself with the D
sky 2015/06/05 19:13:30 SG
GURL url(response->url);
@@ -258,6 +263,9 @@ void HTMLDocument::frameDetached(blink::WebFrame* frame) {
if (frame->parent())
frame->parent()->removeChild(frame);
+ if (devtools_agent_ && frame == devtools_agent_->frame())
+ devtools_agent_.reset();
+
// |frame| is invalid after here.
frame->close();
}
« components/html_viewer/devtools_agent_impl.cc ('K') | « components/html_viewer/html_document.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698