summaryrefslogtreecommitdiffstats
path: root/views/controls/textfield/native_textfield_views.h
diff options
context:
space:
mode:
authorsuzhe@google.com <suzhe@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-23 22:34:21 +0000
committersuzhe@google.com <suzhe@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-23 22:34:21 +0000
commit8ca0956daa88097630611ee296a32e758305b067 (patch)
treeb2c22f0ebb163e72e0db2d6d2dbdbf9b7f09492e /views/controls/textfield/native_textfield_views.h
parent3dd6e99d51bef9124984ab8a6ba8cead6531108a (diff)
downloadchromium_src-8ca0956daa88097630611ee296a32e758305b067.zip
chromium_src-8ca0956daa88097630611ee296a32e758305b067.tar.gz
chromium_src-8ca0956daa88097630611ee296a32e758305b067.tar.bz2
Refactor Textfield and AutocompleteEditViewViews.
Changes made by this CL: 1. Adds OnBeforeUserAction() and OnAfterUserAction() in TextfieldController. 2. Adds Textfield::HasSelection(). 3. Changes NativeTextfieldViews to use KeyEvent::GetCharacter(). 3. Refactors AutocompleteEditViewViews to use new TextfieldController methods. BUG=75003 TEST=views_unittests --gtest_filter=*Textfield* and interactive_ui_tests --gtest_filter=AutocompleteEditViewViews* Review URL: http://codereview.chromium.org/6685082 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79201 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/textfield/native_textfield_views.h')
-rw-r--r--views/controls/textfield/native_textfield_views.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/views/controls/textfield/native_textfield_views.h b/views/controls/textfield/native_textfield_views.h
index 1f80147..7cc8317f 100644
--- a/views/controls/textfield/native_textfield_views.h
+++ b/views/controls/textfield/native_textfield_views.h
@@ -169,10 +169,6 @@ class NativeTextfieldViews : public views::View,
// Handle the keyevent.
bool HandleKeyEvent(const KeyEvent& key_event);
- // Utility function. Gets the character corresponding to a keyevent.
- // Returns 0 if the character is not printable.
- char16 GetPrintableChar(const KeyEvent& key_event);
-
// Find a cusor position for given |point| in this views coordinates.
size_t FindCursorPosition(const gfx::Point& point) const;
@@ -194,6 +190,16 @@ class NativeTextfieldViews : public views::View,
// Utility function to create the context menu if one does not already exist.
void InitContextMenuIfRequired();
+ // Convenience method to call TextfieldController::OnBeforeUserAction();
+ void OnBeforeUserAction();
+
+ // Convenience method to call TextfieldController::OnAfterUserAction();
+ void OnAfterUserAction();
+
+ // Checks if a char is ok to be inserted into the textfield. The |ch| is a
+ // modified character, i.e., modifiers took effect when generating this char.
+ static bool ShouldInsertChar(char16 ch, int flags);
+
// The parent textfield, the owner of this object.
Textfield* textfield_;