| Index: ui/gfx/render_text.h
|
| diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h
|
| index cc4f4e5f66c280b195058a20f29297a5217229a9..3a69c64ed42e49d12e4ac19743fbeae1de3a1529 100644
|
| --- a/ui/gfx/render_text.h
|
| +++ b/ui/gfx/render_text.h
|
| @@ -160,7 +160,7 @@ class UI_EXPORT RenderText {
|
| void set_cursor_visible(bool visible) { cursor_visible_ = visible; }
|
|
|
| bool insert_mode() const { return insert_mode_; }
|
| - void toggle_insert_mode() { insert_mode_ = !insert_mode_; }
|
| + void ToggleInsertMode();
|
|
|
| bool focused() const { return focused_; }
|
| void set_focused(bool focused) { focused_ = focused; }
|
| @@ -176,7 +176,7 @@ class UI_EXPORT RenderText {
|
| // edits take place, and doesn't necessarily correspond to
|
| // SelectionModel::caret_pos.
|
| size_t GetCursorPosition() const;
|
| - void SetCursorPosition(const size_t position);
|
| + void SetCursorPosition(size_t position);
|
|
|
| void SetCaretPlacement(SelectionModel::CaretPlacement placement) {
|
| selection_model_.set_caret_placement(placement);
|
| @@ -184,7 +184,7 @@ class UI_EXPORT RenderText {
|
|
|
| // Moves the cursor left or right. Cursor movement is visual, meaning that
|
| // left and right are relative to screen, not the directionality of the text.
|
| - // If |select| is false, the selection range is emptied at the new position.
|
| + // If |select| is false, the selection start is moved to the same position.
|
| void MoveCursorLeft(BreakType break_type, bool select);
|
| void MoveCursorRight(BreakType break_type, bool select);
|
|
|
| @@ -193,7 +193,8 @@ class UI_EXPORT RenderText {
|
| bool MoveCursorTo(const SelectionModel& selection);
|
|
|
| // Move the cursor to the position associated with the clicked point.
|
| - // If |select| is false, the selection range is emptied at the new position.
|
| + // If |select| is false, the selection start is moved to the same position.
|
| + // Returns true if the cursor position or selection range changed.
|
| bool MoveCursorTo(const Point& point, bool select);
|
|
|
| size_t GetSelectionStart() const {
|
| @@ -289,8 +290,10 @@ class UI_EXPORT RenderText {
|
| FRIEND_TEST_ALL_PREFIXES(RenderTextTest, ApplyStyleRange);
|
| FRIEND_TEST_ALL_PREFIXES(RenderTextTest, StyleRangesAdjust);
|
|
|
| - // Clear out |style_ranges_|.
|
| - void ClearStyleRanges();
|
| + // Set the cursor to |position|, with the caret trailing the previous
|
| + // grapheme, or if there is no previous grapheme, leading the cursor position.
|
| + // If |select| is false, the selection start is moved to the same position.
|
| + void MoveCursorTo(size_t position, bool select);
|
|
|
| bool IsPositionAtWordSelectionBoundary(size_t pos);
|
|
|
|
|