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

Unified Diff: ui/gfx/render_text.h

Issue 2408623002: Views: Extract text selection code from Textfield. (Closed)
Patch Set: Check for |handles_selection_clipboard_| Created 4 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
Index: ui/gfx/render_text.h
diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h
index a16d06351ea3d8770e2d3b3ae0e6482bb200d594..a6efdf4fd0911c3abde48bd197972370411ddf91 100644
--- a/ui/gfx/render_text.h
+++ b/ui/gfx/render_text.h
@@ -341,6 +341,12 @@ class GFX_EXPORT RenderText {
// grapheme boundary), it is a no-op and returns false.
bool MoveCursorTo(const SelectionModel& selection_model);
+ // Moves the cursor to the text index corresponding to |point|. If |select| is
+ // true, a selection is made with the current selection start index. If the
+ // resultant text indices do not lie on valid grapheme boundaries, it is a no-
+ // op and returns false.
+ bool MoveCursorTo(const gfx::Point& point, bool select);
+
// Set the selection_model_ based on |range|.
// If the |range| start or end is greater than text length, it is modified
// to be the text length.

Powered by Google App Engine
This is Rietveld 408576698