Commit 6aba1673 authored by Christopher Cameron's avatar Christopher Cameron Committed by Commit Bot

RemoteMacViews: Forward key events

Populate the method to send these events to the browser.

Bug: 859152
Change-Id: I47f0ba77340eaa185ad2ac58670d9f9909c7a698
Reviewed-on: https://chromium-review.googlesource.com/c/1315705Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: default avatarccameron <ccameron@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605076}
parent 6d003078
...@@ -37,9 +37,22 @@ class Bridge : public BridgedNativeWidgetHostHelper { ...@@ -37,9 +37,22 @@ class Bridge : public BridgedNativeWidgetHostHelper {
// BridgedNativeWidgetHostHelper: // BridgedNativeWidgetHostHelper:
NSView* GetNativeViewAccessible() override { return nil; } NSView* GetNativeViewAccessible() override { return nil; }
void DispatchKeyEvent(ui::KeyEvent* event) override {} void DispatchKeyEvent(ui::KeyEvent* event) override {
bool event_handled = false;
host_ptr_->DispatchKeyEventRemote(std::make_unique<ui::KeyEvent>(*event),
&event_handled);
if (event_handled)
event->SetHandled();
}
bool DispatchKeyEventToMenuController(ui::KeyEvent* event) override { bool DispatchKeyEventToMenuController(ui::KeyEvent* event) override {
return false; bool event_swallowed = false;
bool event_handled = false;
host_ptr_->DispatchKeyEventToMenuControllerRemote(
std::make_unique<ui::KeyEvent>(*event), &event_swallowed,
&event_handled);
if (event_handled)
event->SetHandled();
return event_swallowed;
} }
void GetWordAt(const gfx::Point& location_in_content, void GetWordAt(const gfx::Point& location_in_content,
bool* found_word, bool* found_word,
......
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