Commit 3d54f3a1 authored by Albert Chaulk's avatar Albert Chaulk Committed by Commit Bot

Always focus the webview before sending it input

Bug: b/141992733
Test: None
Change-Id: Ia190abf893cb6dad03f6a0a1e0206b650b7da68f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1841943
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
Reviewed-by: default avatarDaniel Nicoara <dnicoara@chromium.org>
Cr-Commit-Position: refs/heads/master@{#702991}
parent 65619dbb
...@@ -216,6 +216,10 @@ void WebviewController::AttachTo(aura::Window* window, int window_id) { ...@@ -216,6 +216,10 @@ void WebviewController::AttachTo(aura::Window* window, int window_id) {
} }
void WebviewController::ProcessInputEvent(const webview::InputEvent& ev) { void WebviewController::ProcessInputEvent(const webview::InputEvent& ev) {
// Ensure this web contents has focus before sending it input.
if (!contents_->GetNativeView()->HasFocus())
contents_->GetNativeView()->Focus();
ui::EventHandler* handler = contents_->GetNativeView()->delegate(); ui::EventHandler* handler = contents_->GetNativeView()->delegate();
ui::EventType type = static_cast<ui::EventType>(ev.event_type()); ui::EventType type = static_cast<ui::EventType>(ev.event_type());
switch (type) { switch (type) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment