Index: ui/wayland/wayland_input_method_event_filter.h |
diff --git a/ui/wayland/wayland_input_method_event_filter.h b/ui/wayland/wayland_input_method_event_filter.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..65b1e3d3ef23d7c0b6ca50ea476b11cd40923d63 |
--- /dev/null |
+++ b/ui/wayland/wayland_input_method_event_filter.h |
@@ -0,0 +1,40 @@ |
+// Copyright 2013 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. |
+ |
+#ifndef UI_WAYLAND_WAYLAND_INPUT_METHOD_EVENT_FILTER_ |
+#define UI_WAYLAND_WAYLAND_INPUT_METHOD_EVENT_FILTER_ |
+ |
+#include "base/basictypes.h" |
+#include "base/compiler_specific.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "ui/base/ime/input_method_delegate.h" |
+ |
+namespace ui { |
+class InputMethod; |
+ |
+// An event filter that forwards a KeyEvent to a system IME, and dispatches a |
+// TranslatedKeyEvent to the root window as needed. |
+class WaylandInputMethodEventFilter |
+ : public ui::internal::InputMethodDelegate { |
+ public: |
+ WaylandInputMethodEventFilter(); |
+ virtual ~WaylandInputMethodEventFilter(); |
+ |
+ InputMethod* GetInputMethod() const { return input_method_.get(); } |
+ |
+ private: |
+ // Overridden from ui::internal::InputMethodDelegate. |
+ virtual bool DispatchKeyEventPostIME(const base::NativeEvent& event) OVERRIDE; |
+ virtual bool DispatchFabricatedKeyEventPostIME(ui::EventType type, |
+ ui::KeyboardCode key_code, |
+ int flags) OVERRIDE; |
+ |
+ scoped_ptr<ui::InputMethod> input_method_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(WaylandInputMethodEventFilter); |
+}; |
+ |
+} // namespace ui |
+ |
+#endif // UI_WAYLAND_WAYLAND_INPUT_METHOD_EVENT_FILTER_ |