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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « ui/views/controls/textfield/textfield_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_VIEWS_DELEGATE_H_ 5 #ifndef UI_VIEWS_VIEWS_DELEGATE_H_
6 #define UI_VIEWS_VIEWS_DELEGATE_H_ 6 #define UI_VIEWS_VIEWS_DELEGATE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #if defined(OS_WIN) 10 #if defined(OS_WIN)
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 95
96 // Call this method to set a factory callback that will be used to construct 96 // Call this method to set a factory callback that will be used to construct
97 // NativeWidget implementations overriding the platform defaults. 97 // NativeWidget implementations overriding the platform defaults.
98 void set_native_widget_factory(NativeWidgetFactory factory) { 98 void set_native_widget_factory(NativeWidgetFactory factory) {
99 native_widget_factory_ = factory; 99 native_widget_factory_ = factory;
100 } 100 }
101 const NativeWidgetFactory& native_widget_factory() { 101 const NativeWidgetFactory& native_widget_factory() {
102 return native_widget_factory_; 102 return native_widget_factory_;
103 } 103 }
104 104
105 // Access the text buffer used to implement the "Yank" text edit command.
106 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
107 kill_buffer_ = kill_buffer;
108 }
109 const base::string16& kill_buffer() const { return kill_buffer_; }
110
105 // Saves the position, size and "show" state for the window with the 111 // Saves the position, size and "show" state for the window with the
106 // specified name. 112 // specified name.
107 virtual void SaveWindowPlacement(const Widget* widget, 113 virtual void SaveWindowPlacement(const Widget* widget,
108 const std::string& window_name, 114 const std::string& window_name,
109 const gfx::Rect& bounds, 115 const gfx::Rect& bounds,
110 ui::WindowShowState show_state); 116 ui::WindowShowState show_state);
111 117
112 // Retrieves the saved position and size and "show" state for the window with 118 // Retrieves the saved position and size and "show" state for the window with
113 // the specified name. 119 // the specified name.
114 virtual bool GetSavedWindowPlacement(const Widget* widget, 120 virtual bool GetSavedWindowPlacement(const Widget* widget,
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 204
199 private: 205 private:
200 std::unique_ptr<ViewsTouchEditingControllerFactory> views_tsc_factory_; 206 std::unique_ptr<ViewsTouchEditingControllerFactory> views_tsc_factory_;
201 207
202 #if defined(USE_AURA) 208 #if defined(USE_AURA)
203 std::unique_ptr<TouchSelectionMenuRunnerViews> touch_selection_menu_runner_; 209 std::unique_ptr<TouchSelectionMenuRunnerViews> touch_selection_menu_runner_;
204 #endif 210 #endif
205 211
206 NativeWidgetFactory native_widget_factory_; 212 NativeWidgetFactory native_widget_factory_;
207 213
214 // Buffer containing the text to be inserted on executing yank command for
215 // views::Texfield. Member of ViewsDelegate since this needs to be persisted
216 // across multiple textfield instances.
217 // On Mac, the size of the kill ring (no. of buffers) is controlled by
218 // NSTextKillRingSize, a text system default. However to keep things simple,
219 // the default kill ring size of 1 (i.e. a single buffer) is assumed.
220 base::string16 kill_buffer_;
221
208 DISALLOW_COPY_AND_ASSIGN(ViewsDelegate); 222 DISALLOW_COPY_AND_ASSIGN(ViewsDelegate);
209 }; 223 };
210 224
211 } // namespace views 225 } // namespace views
212 226
213 #endif // UI_VIEWS_VIEWS_DELEGATE_H_ 227 #endif // UI_VIEWS_VIEWS_DELEGATE_H_
OLDNEW
« 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