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

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 comments. 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
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 const base::string16& kill_buffer() {
tapted 2016/07/20 06:32:21 nit: declare method const
karandeepb 2016/07/20 07:51:30 Done.
106 return kill_buffer_;
107 }
108
109 void set_kill_buffer(const base::string16& kill_buffer) {
tapted 2016/07/20 06:32:21 nit: swap these around and remove the blank line b
karandeepb 2016/07/20 07:51:30 Done.
110 kill_buffer_ = kill_buffer;
111 }
112
105 // Saves the position, size and "show" state for the window with the 113 // Saves the position, size and "show" state for the window with the
106 // specified name. 114 // specified name.
107 virtual void SaveWindowPlacement(const Widget* widget, 115 virtual void SaveWindowPlacement(const Widget* widget,
108 const std::string& window_name, 116 const std::string& window_name,
109 const gfx::Rect& bounds, 117 const gfx::Rect& bounds,
110 ui::WindowShowState show_state); 118 ui::WindowShowState show_state);
111 119
112 // Retrieves the saved position and size and "show" state for the window with 120 // Retrieves the saved position and size and "show" state for the window with
113 // the specified name. 121 // the specified name.
114 virtual bool GetSavedWindowPlacement(const Widget* widget, 122 virtual bool GetSavedWindowPlacement(const Widget* widget,
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 206
199 private: 207 private:
200 std::unique_ptr<ViewsTouchEditingControllerFactory> views_tsc_factory_; 208 std::unique_ptr<ViewsTouchEditingControllerFactory> views_tsc_factory_;
201 209
202 #if defined(USE_AURA) 210 #if defined(USE_AURA)
203 std::unique_ptr<TouchSelectionMenuRunnerViews> touch_selection_menu_runner_; 211 std::unique_ptr<TouchSelectionMenuRunnerViews> touch_selection_menu_runner_;
204 #endif 212 #endif
205 213
206 NativeWidgetFactory native_widget_factory_; 214 NativeWidgetFactory native_widget_factory_;
207 215
216 // Buffer containing the text to be inserted on executing yank command for
217 // Views::Texfield. Member of ViewsDelegate since this needs to be persisted
tapted 2016/07/20 06:32:21 nit: Views -> views
karandeepb 2016/07/20 07:51:30 Done.
218 // across multiple textfield instances.
219 // On Mac, the size of the kill ring (no. of buffers) is controlled by
220 // NSTextKillRingSize, a text system default. However to keep things simple,
221 // the default kill ring size of 1 (i.e. a single buffer) is assumed.
222 base::string16 kill_buffer_;
223
208 DISALLOW_COPY_AND_ASSIGN(ViewsDelegate); 224 DISALLOW_COPY_AND_ASSIGN(ViewsDelegate);
209 }; 225 };
210 226
211 } // namespace views 227 } // namespace views
212 228
213 #endif // UI_VIEWS_VIEWS_DELEGATE_H_ 229 #endif // UI_VIEWS_VIEWS_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698