Index: content/shell/browser/shell_devtools_frontend.cc |
diff --git a/content/shell/browser/shell_devtools_frontend.cc b/content/shell/browser/shell_devtools_frontend.cc |
index 982337a0155b50e36249f6ac5f9bd3e7c6a8be63..d4ffd09b7f7866ed29409315485d797dde6cbb10 100644 |
--- a/content/shell/browser/shell_devtools_frontend.cc |
+++ b/content/shell/browser/shell_devtools_frontend.cc |
@@ -132,8 +132,12 @@ void ShellDevToolsFrontend::Focus() { |
} |
void ShellDevToolsFrontend::InspectElementAt(int x, int y) { |
- if (agent_host_) |
- agent_host_->InspectElement(x, y); |
+ if (agent_host_) { |
+ agent_host_->InspectElement(this, x, y); |
+ } else { |
+ inspect_element_at_x_ = x; |
+ inspect_element_at_y_ = y; |
+ } |
} |
void ShellDevToolsFrontend::Close() { |
@@ -152,6 +156,8 @@ ShellDevToolsFrontend::ShellDevToolsFrontend(Shell* frontend_shell, |
: WebContentsObserver(frontend_shell->web_contents()), |
frontend_shell_(frontend_shell), |
inspected_contents_(inspected_contents), |
+ inspect_element_at_x_(-1), |
+ inspect_element_at_y_(-1), |
weak_factory_(this) { |
} |
@@ -173,6 +179,12 @@ void ShellDevToolsFrontend::RenderViewCreated( |
void ShellDevToolsFrontend::DocumentAvailableInMainFrame() { |
agent_host_ = DevToolsAgentHost::GetOrCreateFor(inspected_contents_); |
agent_host_->AttachClient(this); |
+ if (inspect_element_at_x_ != -1) { |
+ agent_host_->InspectElement( |
+ this, inspect_element_at_x_, inspect_element_at_y_); |
+ inspect_element_at_x_ = -1; |
+ inspect_element_at_y_ = -1; |
+ } |
} |
void ShellDevToolsFrontend::WebContentsDestroyed() { |