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

Unified Diff: ui/views/controls/textfield/textfield_model.h

Issue 2119813002: views::Textfield: Implement yank editing command. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/views/controls/textfield/textfield_model.h
diff --git a/ui/views/controls/textfield/textfield_model.h b/ui/views/controls/textfield/textfield_model.h
index df3e9754e2d52c1e51949b542cf3d2552c56dfc4..a0852ea5ce006752de546a78f2655ad5f281daf9 100644
--- a/ui/views/controls/textfield/textfield_model.h
+++ b/ui/views/controls/textfield/textfield_model.h
@@ -95,15 +95,21 @@ class VIEWS_EXPORT TextfieldModel {
// Deletes the first character after the current cursor position (as if, the
// the user has pressed delete key in the textfield). Returns true if
- // the deletion is successful.
+ // the deletion is successful. If |add_to_kill_buffer| is true, the deleted
+ // text is copied to the kill buffer.
// If there is composition text, it'll be deleted instead.
- bool Delete();
+ bool Delete(bool add_to_kill_buffer);
tapted 2016/07/06 01:46:37 default arguments are allowed by the style guide n
karandeepb 2016/07/19 07:04:40 Done.
+
+ bool Delete() { return Delete(false); }
// Deletes the first character before the current cursor position (as if, the
// the user has pressed backspace key in the textfield). Returns true if
- // the removal is successful.
+ // the removal is successful. If |add_to_kill_buffer| is true, the deleted
+ // text is copied to the kill buffer.
// If there is composition text, it'll be deleted instead.
- bool Backspace();
+ bool Backspace(bool add_to_kill_buffer);
+
+ bool Backspace() { return Backspace(false); }
// Cursor related methods.
@@ -182,6 +188,10 @@ class VIEWS_EXPORT TextfieldModel {
// changed.
bool Transpose();
+ // Pastes text from the kill buffer at the current cursor position or
+ // selection.
+ bool Yank();
+
// Tells if any text is selected, even if the selection is in composition
// text.
bool HasSelection() const;

Powered by Google App Engine
This is Rietveld 408576698