Commit a08f080a authored by Dave Tapuska's avatar Dave Tapuska Committed by Commit Bot

Dispatch Edit Commands at the focused frame.

In https://chromium-review.googlesource.com/c/chromium/src/+/2243266 I
missed that the edit commands were dispatched at the focused frame
from the root frame widget. This caused a slight issue with Ctrl-left
arrow on gmail causing a history back navigation.

BUG=1099459

Change-Id: Iadb39bd3e031dca6e7c1165bf1be674b5de1f978
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2275490
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarMustaq Ahmed <mustaq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#784854}
parent 0eea3ade
......@@ -1120,11 +1120,14 @@ void WebFrameWidgetBase::AddEditCommandForNextKeyEvent(const WebString& name,
bool WebFrameWidgetBase::HandleCurrentKeyboardEvent() {
bool did_execute_command = false;
WebLocalFrame* frame = FocusedWebLocalFrameInWidget();
if (!frame)
frame = local_root_;
for (const auto& command : edit_commands_) {
// In gtk and cocoa, it's possible to bind multiple edit commands to one
// key (but it's the exception). Once one edit command is not executed, it
// seems safest to not execute the rest.
if (!local_root_->ExecuteCommand(command->name, command->value))
if (!frame->ExecuteCommand(command->name, command->value))
break;
did_execute_command = true;
}
......
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