diff options
author | sky <sky@chromium.org> | 2015-08-03 14:57:57 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-03 21:58:30 +0000 |
commit | a6029a4c1483a0cdf9501b012b62bb324f28fd34 (patch) | |
tree | 5ecfdee3320770ca9405215eee7178fb275ce087 /mandoline | |
parent | dc957e1a0229bd9b4764f74707b28672ae7f50bb (diff) | |
download | chromium_src-a6029a4c1483a0cdf9501b012b62bb324f28fd34.zip chromium_src-a6029a4c1483a0cdf9501b012b62bb324f28fd34.tar.gz chromium_src-a6029a4c1483a0cdf9501b012b62bb324f28fd34.tar.bz2 |
Fixes keyboard input
Recent IME changes mean we have to dispatch the event in
NativeWidgetViewManager (see
DesktopWindowTreeHostX11::DispatchKeyEvent for similar code).
BUG=516460
TEST=none
R=erg@chromium.org
Review URL: https://codereview.chromium.org/1269133003
Cr-Commit-Position: refs/heads/master@{#341627}
Diffstat (limited to 'mandoline')
-rw-r--r-- | mandoline/ui/aura/input_method_mandoline.cc | 4 | ||||
-rw-r--r-- | mandoline/ui/aura/native_widget_view_manager.cc | 12 | ||||
-rw-r--r-- | mandoline/ui/aura/native_widget_view_manager.h | 2 |
3 files changed, 12 insertions, 6 deletions
diff --git a/mandoline/ui/aura/input_method_mandoline.cc b/mandoline/ui/aura/input_method_mandoline.cc index 3ab9203..f1b510b 100644 --- a/mandoline/ui/aura/input_method_mandoline.cc +++ b/mandoline/ui/aura/input_method_mandoline.cc @@ -41,9 +41,7 @@ bool InputMethodMandoline::DispatchKeyEvent(const ui::KeyEvent& event) { // character event, we instead check to see if this is a character event and // send out the key if it is. (We fallback to normal dispatch if it isn't.) if (event.is_char()) { - const uint16 ch = event.GetCharacter(); - if (GetTextInputClient()) - GetTextInputClient()->InsertChar(ch, event.flags()); + GetTextInputClient()->InsertChar(event.GetCharacter(), event.flags()); return false; } diff --git a/mandoline/ui/aura/native_widget_view_manager.cc b/mandoline/ui/aura/native_widget_view_manager.cc index 0af2b37..cdc03b3 100644 --- a/mandoline/ui/aura/native_widget_view_manager.cc +++ b/mandoline/ui/aura/native_widget_view_manager.cc @@ -102,9 +102,17 @@ void NativeWidgetViewManager::OnViewFocusChanged(mojo::View* gained_focus, void NativeWidgetViewManager::OnViewInputEvent(mojo::View* view, const mojo::EventPtr& event) { - scoped_ptr<ui::Event> ui_event(event.To<scoped_ptr<ui::Event> >()); - if (ui_event) + scoped_ptr<ui::Event> ui_event(event.To<scoped_ptr<ui::Event>>()); + if (!ui_event) + return; + + if (ui_event->IsKeyEvent()) { + window_tree_host_->GetInputMethod()->DispatchKeyEvent( + *static_cast<ui::KeyEvent*>(ui_event.get())); + ui_event->StopPropagation(); + } else { window_tree_host_->SendEventToProcessor(ui_event.get()); + } } } // namespace mandoline diff --git a/mandoline/ui/aura/native_widget_view_manager.h b/mandoline/ui/aura/native_widget_view_manager.h index 8042b08..3841f03 100644 --- a/mandoline/ui/aura/native_widget_view_manager.h +++ b/mandoline/ui/aura/native_widget_view_manager.h @@ -33,7 +33,7 @@ namespace mandoline { class WindowTreeHostMojo; class NativeWidgetViewManager : public views::NativeWidgetAura, - public mojo::ViewObserver { + public mojo::ViewObserver { public: NativeWidgetViewManager(views::internal::NativeWidgetDelegate* delegate, mojo::Shell* shell, |