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

Unified Diff: views/widget/widget_win.h

Issue 6675005: Integrate the new input method API for Views into Chromium. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 years, 9 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
Index: views/widget/widget_win.h
diff --git a/views/widget/widget_win.h b/views/widget/widget_win.h
index b5bc23c44d349799fddd44b2dd67dceb2511db4a..a571552b7ef11ac39a7c5142d9d0f3f1cb7a7eb1 100644
--- a/views/widget/widget_win.h
+++ b/views/widget/widget_win.h
@@ -20,6 +20,7 @@
#include "base/win/scoped_comptr.h"
#include "ui/base/win/window_impl.h"
#include "views/focus/focus_manager.h"
+#include "views/ime/input_method_delegate.h"
#include "views/layout/layout_manager.h"
#include "views/widget/native_widget.h"
#include "views/widget/widget.h"
@@ -81,7 +82,8 @@ const int WM_NCUAHDRAWFRAME = 0xAF;
class WidgetWin : public ui::WindowImpl,
public Widget,
public NativeWidget,
- public MessageLoopForUI::Observer {
+ public MessageLoopForUI::Observer,
+ public internal::InputMethodDelegate {
public:
WidgetWin();
virtual ~WidgetWin();
@@ -209,6 +211,8 @@ class WidgetWin : public ui::WindowImpl,
virtual void SetNativeCapture() OVERRIDE;
virtual void ReleaseNativeCapture() OVERRIDE;
virtual bool HasNativeCapture() const OVERRIDE;
+ virtual InputMethod* GetInputMethodNative() OVERRIDE;
+ virtual void ReplaceInputMethod(InputMethod* input_method) OVERRIDE;
virtual gfx::Rect GetWindowScreenBounds() const OVERRIDE;
virtual gfx::Rect GetClientAreaScreenBounds() const OVERRIDE;
virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
@@ -272,8 +276,18 @@ class WidgetWin : public ui::WindowImpl,
// Key events.
MESSAGE_HANDLER_EX(WM_KEYDOWN, OnKeyDown)
MESSAGE_HANDLER_EX(WM_KEYUP, OnKeyUp)
- MESSAGE_HANDLER_EX(WM_SYSKEYDOWN, OnKeyDown);
- MESSAGE_HANDLER_EX(WM_SYSKEYUP, OnKeyUp);
+ MESSAGE_HANDLER_EX(WM_SYSKEYDOWN, OnKeyDown)
+ MESSAGE_HANDLER_EX(WM_SYSKEYUP, OnKeyUp)
+
+ // IME Events.
+ MESSAGE_HANDLER_EX(WM_IME_SETCONTEXT, OnImeMessages)
+ MESSAGE_HANDLER_EX(WM_IME_STARTCOMPOSITION, OnImeMessages)
+ MESSAGE_HANDLER_EX(WM_IME_COMPOSITION, OnImeMessages)
+ MESSAGE_HANDLER_EX(WM_IME_ENDCOMPOSITION, OnImeMessages)
+ MESSAGE_HANDLER_EX(WM_CHAR, OnImeMessages)
+ MESSAGE_HANDLER_EX(WM_SYSCHAR, OnImeMessages)
+ MESSAGE_HANDLER_EX(WM_DEADCHAR, OnImeMessages)
+ MESSAGE_HANDLER_EX(WM_SYSDEADCHAR, OnImeMessages)
// This list is in _ALPHABETICAL_ order! OR I WILL HURT YOU.
MSG_WM_ACTIVATE(OnActivate)
@@ -295,6 +309,7 @@ class WidgetWin : public ui::WindowImpl,
MSG_WM_HSCROLL(OnHScroll)
MSG_WM_INITMENU(OnInitMenu)
MSG_WM_INITMENUPOPUP(OnInitMenuPopup)
+ MSG_WM_INPUTLANGCHANGE(OnInputLangChange)
MSG_WM_KILLFOCUS(OnKillFocus)
MSG_WM_MOVE(OnMove)
MSG_WM_MOVING(OnMoving)
@@ -349,8 +364,10 @@ class WidgetWin : public ui::WindowImpl,
virtual LRESULT OnGetObject(UINT uMsg, WPARAM w_param, LPARAM l_param);
virtual void OnGetMinMaxInfo(MINMAXINFO* minmax_info);
virtual void OnHScroll(int scroll_type, short position, HWND scrollbar);
+ virtual LRESULT OnImeMessages(UINT message, WPARAM w_param, LPARAM l_param);
virtual void OnInitMenu(HMENU menu);
virtual void OnInitMenuPopup(HMENU menu, UINT position, BOOL is_system_menu);
+ virtual void OnInputLangChange(DWORD character_set, HKL input_language_id);
virtual LRESULT OnKeyDown(UINT message, WPARAM w_param, LPARAM l_param);
virtual LRESULT OnKeyUp(UINT message, WPARAM w_param, LPARAM l_param);
virtual void OnKillFocus(HWND focused_window);
@@ -457,6 +474,9 @@ class WidgetWin : public ui::WindowImpl,
// Overridden from NativeWidget.
virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
+ // Overridden from internal::InputMethodDelegate
+ virtual void DispatchKeyEventPostIME(const KeyEvent& key) OVERRIDE;
+
// A delegate implementation that handles events received here.
internal::NativeWidgetDelegate* delegate_;
@@ -542,6 +562,11 @@ class WidgetWin : public ui::WindowImpl,
ViewProps props_;
+ scoped_ptr<InputMethod> input_method_;
+
+ // Indicates if the |input_method_| is an InputMethodWin instance.
+ bool is_input_method_win_;
+
DISALLOW_COPY_AND_ASSIGN(WidgetWin);
};

Powered by Google App Engine
This is Rietveld 408576698