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

Unified Diff: mojo/examples/launcher/launcher.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
Index: mojo/examples/launcher/launcher.cc
diff --git a/mojo/examples/launcher/launcher.cc b/mojo/examples/launcher/launcher.cc
index 042a7bdbc2cdbabc3a5d994e3ce6665797e4eb2e..0b8e8c2ee6dd7d8242ce3fb20bdd7777a18e114a 100644
--- a/mojo/examples/launcher/launcher.cc
+++ b/mojo/examples/launcher/launcher.cc
@@ -82,12 +82,10 @@ class MinimalInputEventFilter : public ui::internal::InputMethodDelegate,
private:
// ui::EventHandler:
virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE {
- 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 (input_method_->DispatchKeyEvent(*event))
event->StopPropagation();
@@ -96,7 +94,8 @@ class MinimalInputEventFilter : public ui::internal::InputMethodDelegate,
// ui::internal::InputMethodDelegate:
virtual bool DispatchKeyEventPostIME(const ui::KeyEvent& event) OVERRIDE {
- ui::TranslatedKeyEvent aura_event(event);
+ ui::KeyEvent aura_event(event);
+ aura_event.SetTranslated(true);
ui::EventDispatchDetails details =
root_->GetHost()->dispatcher()->OnEventFromSource(&aura_event);
return aura_event.handled() || details.dispatcher_destroyed;

Powered by Google App Engine
This is Rietveld 408576698