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

Unified Diff: ash/ime/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: move to ash/ime/ 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
« no previous file with comments | « ash/ime/event.h ('k') | ash/ime/input_method_event_filter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/ime/event.cc
diff --git a/ash/ime/event.cc b/ash/ime/event.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a9d2622418244669b54cf304f2f4bf77deb75ba7
--- /dev/null
+++ b/ash/ime/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 "ash/ime/event.h"
+
+namespace ash {
+
+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 ash
« no previous file with comments | « ash/ime/event.h ('k') | ash/ime/input_method_event_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698