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

Unified Diff: content/shell/browser/shell_devtools_bindings.cc

Issue 2837083003: DevTools: create test infrastructure so devtools drives the test (Closed)
Patch Set: fix Created 3 years, 6 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/shell/browser/shell_devtools_bindings.cc
diff --git a/content/shell/browser/shell_devtools_bindings.cc b/content/shell/browser/shell_devtools_bindings.cc
index 8c0712262b0362f207078f967b5972a74aea27c8..fdbb8c53793431c39a10a7dbcb6bd8a3106fcce9 100644
--- a/content/shell/browser/shell_devtools_bindings.cc
+++ b/content/shell/browser/shell_devtools_bindings.cc
@@ -137,6 +137,9 @@ void ShellDevToolsBindings::ReadyToCommitNavigation(
NavigationHandle* navigation_handle) {
#if !defined(OS_ANDROID)
content::RenderFrameHost* frame = navigation_handle->GetRenderFrameHost();
+ if (navigation_handle->IsInMainFrame()) {
+ CreateFrontendHost(frame);
+ }
if (!frame->GetParent())
dgozman 2017/06/15 21:16:48 This is the same check as previous if - combine th
chenwilliam 2017/06/19 18:33:29 Done.
return;
std::string origin = navigation_handle->GetURL().GetOrigin().spec();
@@ -149,19 +152,13 @@ void ShellDevToolsBindings::ReadyToCommitNavigation(
#endif
}
-void ShellDevToolsBindings::RenderViewCreated(
- RenderViewHost* render_view_host) {
- CreateFrontendHost();
-}
-
#if !defined(OS_ANDROID)
-void ShellDevToolsBindings::CreateFrontendHost() {
- if (!frontend_host_) {
- frontend_host_.reset(DevToolsFrontendHost::Create(
- web_contents()->GetMainFrame(),
- base::Bind(&ShellDevToolsBindings::HandleMessageFromDevToolsFrontend,
- base::Unretained(this))));
- }
+void ShellDevToolsBindings::CreateFrontendHost(
dgozman 2017/06/15 21:16:48 Inline it to the method above.
chenwilliam 2017/06/19 18:33:29 Done.
+ RenderFrameHost* render_frame_host) {
+ frontend_host_.reset(DevToolsFrontendHost::Create(
+ render_frame_host,
+ base::Bind(&ShellDevToolsBindings::HandleMessageFromDevToolsFrontend,
+ base::Unretained(this))));
}
#endif

Powered by Google App Engine
This is Rietveld 408576698