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

Side by Side Diff: ui/views/controls/textfield/textfield_model.h

Issue 1865063004: views: support vertical-drag-to-end on textfields (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_MODEL_H_ 5 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_MODEL_H_
6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_MODEL_H_ 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_MODEL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 gfx::VisualCursorDirection direction, 116 gfx::VisualCursorDirection direction,
117 bool select); 117 bool select);
118 118
119 // Updates the cursor to the specified selection model. Any composition text 119 // Updates the cursor to the specified selection model. Any composition text
120 // will be confirmed, which may alter the specified selection range start. 120 // will be confirmed, which may alter the specified selection range start.
121 bool MoveCursorTo(const gfx::SelectionModel& cursor); 121 bool MoveCursorTo(const gfx::SelectionModel& cursor);
122 122
123 // Helper function to call MoveCursorTo on the TextfieldModel. 123 // Helper function to call MoveCursorTo on the TextfieldModel.
124 bool MoveCursorTo(const gfx::Point& point, bool select); 124 bool MoveCursorTo(const gfx::Point& point, bool select);
125 125
126 // Helper functions to move the cursor to the start and end.
127 void MoveCursorToStart(bool select);
tapted 2016/04/06 23:29:38 nit `select` is always in this code, so in Chrome'
Elly Fong-Jones 2016/04/07 17:43:47 Removed these methods.
128 void MoveCursorToEnd(bool select);
129
126 // Selection related methods. 130 // Selection related methods.
127 131
128 // Returns the selected text. 132 // Returns the selected text.
129 base::string16 GetSelectedText() const; 133 base::string16 GetSelectedText() const;
130 134
131 // The current composition text will be confirmed. The selection starts with 135 // The current composition text will be confirmed. The selection starts with
132 // the range's start position, and ends with the range's end position, 136 // the range's start position, and ends with the range's end position,
133 // therefore the cursor position becomes the end position. 137 // therefore the cursor position becomes the end position.
134 void SelectRange(const gfx::Range& range); 138 void SelectRange(const gfx::Range& range);
135 139
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 // 2) new edit is added. (redo history is cleared) 293 // 2) new edit is added. (redo history is cleared)
290 // 3) redone all undone edits. 294 // 3) redone all undone edits.
291 EditHistory::iterator current_edit_; 295 EditHistory::iterator current_edit_;
292 296
293 DISALLOW_COPY_AND_ASSIGN(TextfieldModel); 297 DISALLOW_COPY_AND_ASSIGN(TextfieldModel);
294 }; 298 };
295 299
296 } // namespace views 300 } // namespace views
297 301
298 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_MODEL_H_ 302 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698