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

Unified Diff: ui/aura_shell/event.cc

Issue 8576005: IME (input method editor) support for Aura, part 3 of 3: Use ui::InputMethod in ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fixes Created 9 years 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: ui/aura_shell/event.cc
diff --git a/ui/aura_shell/event.cc b/ui/aura_shell/event.cc
new file mode 100644
index 0000000000000000000000000000000000000000..16d410c46b835e9d9654455926fcc7a23b7e7a50
--- /dev/null
+++ b/ui/aura_shell/event.cc
@@ -0,0 +1,30 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/aura_shell/event.h"
+
+namespace aura_shell {
+
+TranslatedKeyEvent::TranslatedKeyEvent(const base::NativeEvent& native_event,
+ bool is_char)
+ : KeyEvent(native_event, is_char) {
+ set_type(type() == ui::ET_KEY_PRESSED ?
+ ui::ET_TRANSLATED_KEY_PRESS : ui::ET_TRANSLATED_KEY_RELEASE);
+}
+
+TranslatedKeyEvent::TranslatedKeyEvent(bool is_press,
+ ui::KeyboardCode key_code,
+ int flags)
+ : KeyEvent((is_press ?
+ ui::ET_TRANSLATED_KEY_PRESS : ui::ET_TRANSLATED_KEY_RELEASE),
+ key_code,
+ flags) {
+}
+
+void TranslatedKeyEvent::ConvertToKeyEvent() {
+ set_type(type() == ui::ET_TRANSLATED_KEY_PRESS ?
+ ui::ET_KEY_PRESSED : ui::ET_KEY_RELEASED);
+}
+
+} // namespace aura_shell

Powered by Google App Engine
This is Rietveld 408576698