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

Unified Diff: ui/views/views_delegate.h

Issue 2119813002: views::Textfield: Implement yank editing command. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review. Created 4 years, 5 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
« no previous file with comments | « ui/views/controls/textfield/textfield_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/views_delegate.h
diff --git a/ui/views/views_delegate.h b/ui/views/views_delegate.h
index 54b5c4383e8d39aaf32dfdc58856ff712925a194..f83b1339f8edd1bcc543c31491f89413f4fcdbf8 100644
--- a/ui/views/views_delegate.h
+++ b/ui/views/views_delegate.h
@@ -102,6 +102,12 @@ class VIEWS_EXPORT ViewsDelegate {
return native_widget_factory_;
}
+ // Access the text buffer used to implement the "Yank" text edit command.
+ void set_kill_buffer(const base::string16& kill_buffer) {
sky 2016/07/20 15:45:57 Is there a reason this needs to be on ViewsDelegat
karandeepb 2016/07/21 00:44:58 The cpp style guide forbids static storage duratio
tapted 2016/07/21 01:08:23 this came up in review earlier at https://coderevi
+ kill_buffer_ = kill_buffer;
+ }
+ const base::string16& kill_buffer() const { return kill_buffer_; }
+
// Saves the position, size and "show" state for the window with the
// specified name.
virtual void SaveWindowPlacement(const Widget* widget,
@@ -205,6 +211,14 @@ class VIEWS_EXPORT ViewsDelegate {
NativeWidgetFactory native_widget_factory_;
+ // Buffer containing the text to be inserted on executing yank command for
+ // views::Texfield. Member of ViewsDelegate since this needs to be persisted
+ // across multiple textfield instances.
+ // On Mac, the size of the kill ring (no. of buffers) is controlled by
+ // NSTextKillRingSize, a text system default. However to keep things simple,
+ // the default kill ring size of 1 (i.e. a single buffer) is assumed.
+ base::string16 kill_buffer_;
+
DISALLOW_COPY_AND_ASSIGN(ViewsDelegate);
};
« no previous file with comments | « ui/views/controls/textfield/textfield_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698