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

Unified Diff: ui/wm/core/input_method_event_filter.cc

Issue 267723008: Retires ui::TranslatedKeyEvent and replaces it with KeyEvent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
« ui/events/event.cc ('K') | « ui/keyboard/keyboard_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/input_method_event_filter.cc
diff --git a/ui/wm/core/input_method_event_filter.cc b/ui/wm/core/input_method_event_filter.cc
index 4854a1b5f99239498fd06323cd99ff7362c9a40f..c377d3b847a9f4aa9189a88e0c7a61acda4379d6 100644
--- a/ui/wm/core/input_method_event_filter.cc
+++ b/ui/wm/core/input_method_event_filter.cc
@@ -37,12 +37,10 @@ void InputMethodEventFilter::SetInputMethodPropertyInRootWindow(
// InputMethodEventFilter, EventFilter implementation:
void InputMethodEventFilter::OnKeyEvent(ui::KeyEvent* event) {
- const ui::EventType type = event->type();
- if (type == ui::ET_TRANSLATED_KEY_PRESS ||
- type == ui::ET_TRANSLATED_KEY_RELEASE) {
+ if (event->IsTranslated()) {
// The |event| is already handled by this object, change the type of the
// event to ui::ET_KEY_* and pass it to the next filter.
- static_cast<ui::TranslatedKeyEvent*>(event)->ConvertToKeyEvent();
+ event->SetTranslated(false);
} else {
// If the focused window is changed, all requests to IME will be
// discarded so it's safe to update the target_dispatcher_ here.
@@ -62,7 +60,8 @@ bool InputMethodEventFilter::DispatchKeyEventPostIME(
#if defined(OS_WIN)
DCHECK(!event.HasNativeEvent() || event.native_event().message != WM_CHAR);
#endif
- ui::TranslatedKeyEvent aura_event(event);
+ ui::KeyEvent aura_event(event);
+ aura_event.SetTranslated(true);
ui::EventDispatchDetails details =
target_dispatcher_->OnEventFromSource(&aura_event);
CHECK(!details.dispatcher_destroyed);
« ui/events/event.cc ('K') | « ui/keyboard/keyboard_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698