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

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

Issue 2837083003: DevTools: create test infrastructure so devtools drives the test (Closed)
Patch Set: rebaseline 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
« no previous file with comments | « content/shell/browser/shell_devtools_bindings.h ('k') | content/shell/test_runner/test_interfaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3bedaad7f3b973dd30fc2a46f9c63bcc82db9d58 100644
--- a/content/shell/browser/shell_devtools_bindings.cc
+++ b/content/shell/browser/shell_devtools_bindings.cc
@@ -137,8 +137,13 @@ void ShellDevToolsBindings::ReadyToCommitNavigation(
NavigationHandle* navigation_handle) {
#if !defined(OS_ANDROID)
content::RenderFrameHost* frame = navigation_handle->GetRenderFrameHost();
- if (!frame->GetParent())
+ if (navigation_handle->IsInMainFrame()) {
+ frontend_host_.reset(DevToolsFrontendHost::Create(
+ frame,
+ base::Bind(&ShellDevToolsBindings::HandleMessageFromDevToolsFrontend,
+ base::Unretained(this))));
return;
+ }
std::string origin = navigation_handle->GetURL().GetOrigin().spec();
auto it = extensions_api_.find(origin);
if (it == extensions_api_.end())
@@ -149,26 +154,6 @@ 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))));
- }
-}
-#endif
-
-#if defined(OS_ANDROID)
-void ShellDevToolsBindings::CreateFrontendHost() {}
-#endif
-
void ShellDevToolsBindings::DocumentAvailableInMainFrame() {
agent_host_ = DevToolsAgentHost::GetOrCreateFor(inspected_contents_);
agent_host_->AttachClient(this);
« no previous file with comments | « content/shell/browser/shell_devtools_bindings.h ('k') | content/shell/test_runner/test_interfaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698