| OLD | NEW |
| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 // Cursor related methods. | 108 // Cursor related methods. |
| 109 | 109 |
| 110 // Returns the current cursor position. | 110 // Returns the current cursor position. |
| 111 size_t GetCursorPosition() const; | 111 size_t GetCursorPosition() const; |
| 112 | 112 |
| 113 // Moves the cursor, see RenderText for additional details. | 113 // Moves the cursor, see RenderText for additional details. |
| 114 // The current composition text will be confirmed. | 114 // The current composition text will be confirmed. |
| 115 void MoveCursor(gfx::BreakType break_type, | 115 void MoveCursor(gfx::BreakType break_type, |
| 116 gfx::VisualCursorDirection direction, | 116 gfx::VisualCursorDirection direction, |
| 117 bool select); | 117 bool select, |
| 118 gfx::SelectionReversedBehavior select_behavior); |
| 119 |
| 120 void MoveCursor(gfx::BreakType break_type, |
| 121 gfx::VisualCursorDirection direction, |
| 122 bool select) { |
| 123 MoveCursor(break_type, direction, select, gfx::SELECTION_DEFAULT); |
| 124 } |
| 118 | 125 |
| 119 // Updates the cursor to the specified selection model. Any composition text | 126 // Updates the cursor to the specified selection model. Any composition text |
| 120 // will be confirmed, which may alter the specified selection range start. | 127 // will be confirmed, which may alter the specified selection range start. |
| 121 bool MoveCursorTo(const gfx::SelectionModel& cursor); | 128 bool MoveCursorTo(const gfx::SelectionModel& cursor); |
| 122 | 129 |
| 123 // Helper function to call MoveCursorTo on the TextfieldModel. | 130 // Helper function to call MoveCursorTo on the TextfieldModel. |
| 124 bool MoveCursorTo(const gfx::Point& point, bool select); | 131 bool MoveCursorTo(const gfx::Point& point, bool select); |
| 125 | 132 |
| 126 // Selection related methods. | 133 // Selection related methods. |
| 127 | 134 |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 // 2) new edit is added. (redo history is cleared) | 296 // 2) new edit is added. (redo history is cleared) |
| 290 // 3) redone all undone edits. | 297 // 3) redone all undone edits. |
| 291 EditHistory::iterator current_edit_; | 298 EditHistory::iterator current_edit_; |
| 292 | 299 |
| 293 DISALLOW_COPY_AND_ASSIGN(TextfieldModel); | 300 DISALLOW_COPY_AND_ASSIGN(TextfieldModel); |
| 294 }; | 301 }; |
| 295 | 302 |
| 296 } // namespace views | 303 } // namespace views |
| 297 | 304 |
| 298 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_MODEL_H_ | 305 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_MODEL_H_ |
| OLD | NEW |