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

Unified Diff: views/controls/textfield/textfield_views_model.h

Issue 6267002: Implement double/triple click functionality in views textfield. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: minor refactoring Created 9 years, 11 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/controls/textfield/textfield_views_model.h
diff --git a/views/controls/textfield/textfield_views_model.h b/views/controls/textfield/textfield_views_model.h
index 176bc6e6a5b427af2d113a52b77e3dbef5ae9f18..00d27e5519717cd057d374f69ec700cde7331c7a 100644
--- a/views/controls/textfield/textfield_views_model.h
+++ b/views/controls/textfield/textfield_views_model.h
@@ -117,6 +117,9 @@ class TextfieldViewsModel {
// Selects all text.
void SelectAll();
+ // Selects the word at which the cursor is currently positioned.
+ void SelectWord();
+
// Clears selection.
void ClearSelection();
@@ -149,6 +152,9 @@ class TextfieldViewsModel {
// Returns the visible text given |start| and |end|.
string16 GetVisibleText(size_t start, size_t end) const;
+ // Utility for SelectWord(). Checks whether position pos is at word boundary.
+ bool IsPositionAtWordSelectionBoundary(size_t pos);
+
// The text in utf16 format.
string16 text_;

Powered by Google App Engine
This is Rietveld 408576698