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

Unified Diff: ash/ime/input_method_event_filter.h

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.cc ('k') | ash/ime/input_method_event_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/ime/input_method_event_filter.h
diff --git a/ash/ime/input_method_event_filter.h b/ash/ime/input_method_event_filter.h
new file mode 100644
index 0000000000000000000000000000000000000000..dcafe6732ceb0c6bf980fe6ee70b67c3db0fd2ea
--- /dev/null
+++ b/ash/ime/input_method_event_filter.h
@@ -0,0 +1,56 @@
+// 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.
+
+#ifndef ASH_WM_INPUT_METHOD_EVENT_FILTER_
+#define ASH_WM_INPUT_METHOD_EVENT_FILTER_
+#pragma once
+
+#include "ash/ash_export.h"
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "ui/aura/event_filter.h"
+#include "ui/base/ime/input_method_delegate.h"
+
+namespace ui {
+class InputMethod;
+}
+
+namespace ash {
+namespace internal {
+
+// An event filter that forwards a KeyEvent to a system IME, and dispatches a
+// TranslatedKeyEvent to the root window as needed.
+class ASH_EXPORT InputMethodEventFilter
+ : public aura::EventFilter,
+ public ui::internal::InputMethodDelegate {
+ public:
+ InputMethodEventFilter();
+ virtual ~InputMethodEventFilter();
+
+ private:
+ // Overridden from aura::EventFilter:
+ virtual bool PreHandleKeyEvent(aura::Window* target,
+ aura::KeyEvent* event) OVERRIDE;
+ virtual bool PreHandleMouseEvent(aura::Window* target,
+ aura::MouseEvent* event) OVERRIDE;
+ virtual ui::TouchStatus PreHandleTouchEvent(
+ aura::Window* target,
+ aura::TouchEvent* event) OVERRIDE;
+
+ // Overridden from ui::internal::InputMethodDelegate.
+ virtual void DispatchKeyEventPostIME(const base::NativeEvent& event) OVERRIDE;
+ virtual void DispatchFabricatedKeyEventPostIME(ui::EventType type,
+ ui::KeyboardCode key_code,
+ int flags) OVERRIDE;
+
+ scoped_ptr<ui::InputMethod> input_method_;
+
+ DISALLOW_COPY_AND_ASSIGN(InputMethodEventFilter);
+};
+
+} // namespace internal
+} // namespace ash
+
+#endif // ASH_WM_INPUT_METHOD_EVENT_FILTER_
« no previous file with comments | « ash/ime/event.cc ('k') | ash/ime/input_method_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698