OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_VIEWS_MODEL_H_ | 5 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ |
6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ | 6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <vector> | 10 #include <vector> |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 // edit in the edit history. | 252 // edit in the edit history. |
253 void ReplaceTextInternal(const string16& text, bool mergeable); | 253 void ReplaceTextInternal(const string16& text, bool mergeable); |
254 | 254 |
255 // Clears all edit history. | 255 // Clears all edit history. |
256 void ClearEditHistory(); | 256 void ClearEditHistory(); |
257 | 257 |
258 // Clears redo history. | 258 // Clears redo history. |
259 void ClearRedoHistory(); | 259 void ClearRedoHistory(); |
260 | 260 |
261 // Executes and records edit operations. | 261 // Executes and records edit operations. |
262 void ExecuteAndRecordDelete(size_t from, size_t to, bool mergeable); | 262 void ExecuteAndRecordDelete(ui::Range range, bool mergeable); |
263 void ExecuteAndRecordReplaceSelection(internal::MergeType merge_type, | 263 void ExecuteAndRecordReplaceSelection(internal::MergeType merge_type, |
264 const string16& text); | 264 const string16& text); |
265 void ExecuteAndRecordReplace(internal::MergeType merge_type, | 265 void ExecuteAndRecordReplace(internal::MergeType merge_type, |
266 size_t old_cursor_pos, | 266 size_t old_cursor_pos, |
267 size_t new_cursor_pos, | 267 size_t new_cursor_pos, |
268 const string16& text, | 268 const string16& text, |
269 size_t new_text_start); | 269 size_t new_text_start); |
270 void ExecuteAndRecordInsert(const string16& text, bool mergeable); | 270 void ExecuteAndRecordInsert(const string16& text, bool mergeable); |
271 | 271 |
272 // Adds or merge |edit| into edit history. Return true if the edit | 272 // Adds or merge |edit| into edit history. Return true if the edit |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 // 2) new edit is added. (redo history is cleared) | 308 // 2) new edit is added. (redo history is cleared) |
309 // 3) redone all undone edits. | 309 // 3) redone all undone edits. |
310 EditHistory::iterator current_edit_; | 310 EditHistory::iterator current_edit_; |
311 | 311 |
312 DISALLOW_COPY_AND_ASSIGN(TextfieldViewsModel); | 312 DISALLOW_COPY_AND_ASSIGN(TextfieldViewsModel); |
313 }; | 313 }; |
314 | 314 |
315 } // namespace views | 315 } // namespace views |
316 | 316 |
317 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ | 317 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_VIEWS_MODEL_H_ |
OLD | NEW |