Index: content/browser/devtools/protocol/input_handler.cc |
diff --git a/content/browser/devtools/protocol/input_handler.cc b/content/browser/devtools/protocol/input_handler.cc |
index 967dd2cd21e0a91ca65631cfd8d26ecea4d3a5ba..cc419a3523f453021293befbc3807a5f073f1e75 100644 |
--- a/content/browser/devtools/protocol/input_handler.cc |
+++ b/content/browser/devtools/protocol/input_handler.cc |
@@ -211,11 +211,17 @@ std::vector<InputHandler*> InputHandler::ForAgentHost( |
void InputHandler::SetRenderFrameHost(RenderFrameHostImpl* host) { |
ClearPendingKeyAndMouseCallbacks(); |
- if (host_) |
+ if (host_) { |
host_->GetRenderWidgetHost()->RemoveInputEventObserver(this); |
+ if (ignore_input_events_) |
+ host_->GetRenderWidgetHost()->SetIgnoreInputEvents(false); |
+ } |
host_ = host; |
- if (host) |
+ if (host) { |
host->GetRenderWidgetHost()->AddInputEventObserver(this); |
+ if (ignore_input_events_) |
+ host_->GetRenderWidgetHost()->SetIgnoreInputEvents(true); |
+ } |
} |
void InputHandler::OnInputEvent(const blink::WebInputEvent& event) { |
@@ -246,8 +252,12 @@ void InputHandler::OnSwapCompositorFrame( |
Response InputHandler::Disable() { |
ClearPendingKeyAndMouseCallbacks(); |
- if (host_) |
+ if (host_) { |
host_->GetRenderWidgetHost()->RemoveInputEventObserver(this); |
+ if (ignore_input_events_) |
+ host_->GetRenderWidgetHost()->SetIgnoreInputEvents(false); |
+ } |
+ ignore_input_events_ = false; |
return Response::OK(); |
} |
@@ -458,6 +468,13 @@ Response InputHandler::EmulateTouchFromMouseEvent(const std::string& type, |
return Response::OK(); |
} |
+Response InputHandler::SetIgnoreInputEvents(bool ignore) { |
+ ignore_input_events_ = ignore; |
+ if (host_) |
+ host_->GetRenderWidgetHost()->SetIgnoreInputEvents(ignore); |
+ return Response::OK(); |
+} |
+ |
void InputHandler::SynthesizePinchGesture( |
int x, |
int y, |