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

Unified Diff: ui/views/controls/textfield/native_textfield_win.h

Issue 11305002: Support TSF related event handling on NativeTextField (Closed) Base URL: http://git.chromium.org/chromium/src.git@findbar_fix
Patch Set: Address comments Created 8 years, 2 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/base/ime/win/tsf_event_router.cc ('k') | ui/views/controls/textfield/native_textfield_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/native_textfield_win.h
diff --git a/ui/views/controls/textfield/native_textfield_win.h b/ui/views/controls/textfield/native_textfield_win.h
index 939786f5402dda47f6f0e2164b1aadcf9f87bfcf..08aba4cf877f76700564b25f49636bc82168f400 100644
--- a/ui/views/controls/textfield/native_textfield_win.h
+++ b/ui/views/controls/textfield/native_textfield_win.h
@@ -19,6 +19,7 @@
#include "base/string16.h"
#include "base/win/scoped_comptr.h"
#include "ui/base/models/simple_menu_model.h"
+#include "ui/base/ime/win/tsf_event_router.h"
#include "ui/gfx/insets.h"
#include "ui/base/win/extra_sdk_defines.h"
#include "ui/views/controls/textfield/native_textfield_wrapper.h"
@@ -42,7 +43,8 @@ class NativeTextfieldWin
CWinTraits<kDefaultEditStyle> >,
public CRichEditCommands<NativeTextfieldWin>,
public NativeTextfieldWrapper,
- public ui::SimpleMenuModel::Delegate {
+ public ui::SimpleMenuModel::Delegate,
+ public ui::TsfEventRouterObserver {
public:
DECLARE_WND_SUPERCLASS(L"ViewsTextfieldEdit", MSFTEDIT_CLASS);
@@ -110,6 +112,11 @@ class NativeTextfieldWin
ui::Accelerator* accelerator) OVERRIDE;
virtual void ExecuteCommand(int command_id) OVERRIDE;
+ // Overridden from ui::TsfEventRouterObserver:
+ virtual void OnTextUpdated(const ui::Range& composition_range) OVERRIDE;
+ virtual void OnTsfStartComposition() OVERRIDE;
+ virtual void OnTsfEndComposition() OVERRIDE;
+
// Update accessibility information.
void InitializeAccessibilityInfo();
void UpdateAccessibleState(uint32 state_flag, bool set_value);
@@ -142,6 +149,7 @@ class NativeTextfieldWin
MSG_WM_RBUTTONDOWN(OnNonLButtonDown)
MSG_WM_PASTE(OnPaste)
MSG_WM_SETFOCUS(OnSetFocus)
+ MSG_WM_KILLFOCUS(OnKillFocus)
MSG_WM_SYSCHAR(OnSysChar) // WM_SYSxxx == WM_xxx with ALT down
MSG_WM_SYSKEYDOWN(OnKeyDown)
END_MSG_MAP()
@@ -206,6 +214,7 @@ class NativeTextfieldWin
void OnNonLButtonDown(UINT keys, const CPoint& point);
void OnPaste();
void OnSetFocus(HWND hwnd);
+ void OnKillFocus(HWND hwnd);
void OnSysChar(TCHAR ch, UINT repeat_count, UINT flags);
// Helper function for OnChar() and OnKeyDown() that handles keystrokes that
@@ -245,6 +254,10 @@ class NativeTextfieldWin
// edit.
void SetContainsMouse(bool contains_mouse);
+ // Handles composition related works on both IMM32 and TSF implementation.
+ void OnImeStartCompositionInternal();
+ void OnImeEndCompositionInternal();
+
// Getter for the text_object_model_, used by the ScopedFreeze class. Note
// that the pointer returned here is only valid as long as the Edit is still
// alive.
@@ -302,6 +315,8 @@ class NativeTextfieldWin
// The accessibility state of this object.
int accessibility_state_;
+ scoped_ptr<ui::TsfEventRouter> tsf_event_router_;
+
DISALLOW_COPY_AND_ASSIGN(NativeTextfieldWin);
};
« no previous file with comments | « ui/base/ime/win/tsf_event_router.cc ('k') | ui/views/controls/textfield/native_textfield_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698