Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(654)

Unified Diff: ui/views/corewm/input_method_event_filter.cc

Issue 45733008: sk6_charactercomposer: Merged DispatchKeyEvent and its fabricated version. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/corewm/input_method_event_filter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/corewm/input_method_event_filter.cc
diff --git a/ui/views/corewm/input_method_event_filter.cc b/ui/views/corewm/input_method_event_filter.cc
index 8c99063afb09b1351bbc65e2e4d04c2a99d68f30..821ddfdc11c79e1f0cdb1cebfbd6c66cb1a8a428 100644
--- a/ui/views/corewm/input_method_event_filter.cc
+++ b/ui/views/corewm/input_method_event_filter.cc
@@ -49,12 +49,7 @@ void InputMethodEventFilter::OnKeyEvent(ui::KeyEvent* event) {
aura::Window* target = static_cast<aura::Window*>(event->target());
target_dispatcher_ = target->GetRootWindow()->GetDispatcher();
DCHECK(target_dispatcher_);
- bool handled = false;
- if (event->HasNativeEvent())
- handled = input_method_->DispatchKeyEvent(event->native_event());
- else
- handled = input_method_->DispatchFabricatedKeyEvent(*event);
- if (handled)
+ if (input_method_->DispatchKeyEvent(*event))
event->StopPropagation();
}
}
@@ -63,11 +58,17 @@ void InputMethodEventFilter::OnKeyEvent(ui::KeyEvent* event) {
// InputMethodEventFilter, ui::InputMethodDelegate implementation:
bool InputMethodEventFilter::DispatchKeyEventPostIME(
- const base::NativeEvent& event) {
+ const ui::KeyEvent& event) {
+ if (!event.HasNativeEvent())
+ return DispatchFabricatedKeyEventPostIME(event.type(),
+ event.key_code(),
+ event.flags());
+
+ const base::NativeEvent& native_event = event.native_event();
#if defined(OS_WIN)
- DCHECK(event.message != WM_CHAR);
+ DCHECK(native_event.message != WM_CHAR);
#endif
- ui::TranslatedKeyEvent aura_event(event, false /* is_char */);
+ ui::TranslatedKeyEvent aura_event(native_event, false /* is_char */);
return target_dispatcher_->AsRootWindowHostDelegate()->OnHostKeyEvent(
&aura_event);
}
« no previous file with comments | « ui/views/corewm/input_method_event_filter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698