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

Unified Diff: ui/wayland/wayland_input_method_event_filter.h

Issue 17265006: wayland patch for inspection Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
« no previous file with comments | « ui/wayland/wayland_input_device.cc ('k') | ui/wayland/wayland_input_method_event_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « ui/wayland/wayland_input_device.cc ('k') | ui/wayland/wayland_input_method_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698