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

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: 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 a87157a37a0dfe79d7f572d9059dec7da3041af0..bcdc6bc8d3f3d943735e7c1848459590d08bee14 100644
--- a/views/controls/textfield/textfield_views_model.h
+++ b/views/controls/textfield/textfield_views_model.h
@@ -123,6 +123,9 @@ class TextfieldViewsModel {
// Selects all text.
void SelectAll();
+ // Selects the word at which the cursor is currently positioned.
+ void SelectWord();
+
// Clears selection.
void ClearSelection();
@@ -155,6 +158,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);
+
// Returns the normalized cursor position that does not exceed the
// text length.
size_t GetSafePosition(size_t position) const;
« no previous file with comments | « views/controls/textfield/native_textfield_views_unittest.cc ('k') | views/controls/textfield/textfield_views_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698