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

Side by Side Diff: views/controls/textfield/textfield.h

Issue 8368016: Rebase BookmarkBubble on the new views bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add Textfield::[set_]select_all_on_focus, use GetInitiallyFocusedView. Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ 5 #ifndef VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_
6 #define VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ 6 #define VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_
7 #pragma once 7 #pragma once
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 void set_text_to_display_when_empty(const string16& text) { 150 void set_text_to_display_when_empty(const string16& text) {
151 text_to_display_when_empty_ = text; 151 text_to_display_when_empty_ = text;
152 #if !defined(OS_LINUX) 152 #if !defined(OS_LINUX)
153 NOTIMPLEMENTED(); 153 NOTIMPLEMENTED();
154 #endif 154 #endif
155 } 155 }
156 const string16& text_to_display_when_empty() { 156 const string16& text_to_display_when_empty() {
157 return text_to_display_when_empty_; 157 return text_to_display_when_empty_;
158 } 158 }
159 159
160 bool select_all_on_focus() const { return select_all_on_focus_; }
161 void set_select_all_on_focus(bool select_all_on_focus) {
162 select_all_on_focus_ = select_all_on_focus;
163 }
164
160 // Getter for the horizontal margins that were set. Returns false if 165 // Getter for the horizontal margins that were set. Returns false if
161 // horizontal margins weren't set. 166 // horizontal margins weren't set.
162 bool GetHorizontalMargins(int* left, int* right); 167 bool GetHorizontalMargins(int* left, int* right);
163 168
164 // Getter for the vertical margins that were set. Returns false if vertical 169 // Getter for the vertical margins that were set. Returns false if vertical
165 // margins weren't set. 170 // margins weren't set.
166 bool GetVerticalMargins(int* top, int* bottom); 171 bool GetVerticalMargins(int* top, int* bottom);
167 172
168 // Updates all properties on the textfield. This is invoked internally. 173 // Updates all properties on the textfield. This is invoked internally.
169 // Users of Textfield never need to invoke this directly. 174 // Users of Textfield never need to invoke this directly.
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 // Holds inner textfield margins. 298 // Holds inner textfield margins.
294 gfx::Insets margins_; 299 gfx::Insets margins_;
295 300
296 // Holds whether margins were set. 301 // Holds whether margins were set.
297 bool horizontal_margins_were_set_; 302 bool horizontal_margins_were_set_;
298 bool vertical_margins_were_set_; 303 bool vertical_margins_were_set_;
299 304
300 // Text to display when empty. 305 // Text to display when empty.
301 string16 text_to_display_when_empty_; 306 string16 text_to_display_when_empty_;
302 307
308 // If true, the textfield will select all text when focus is gained.
309 bool select_all_on_focus_;
310
303 // The accessible name of the text field. 311 // The accessible name of the text field.
304 string16 accessible_name_; 312 string16 accessible_name_;
305 313
306 // The input type of this text field. 314 // The input type of this text field.
307 ui::TextInputType text_input_type_; 315 ui::TextInputType text_input_type_;
308 316
309 DISALLOW_COPY_AND_ASSIGN(Textfield); 317 DISALLOW_COPY_AND_ASSIGN(Textfield);
310 }; 318 };
311 319
312 } // namespace views 320 } // namespace views
313 321
314 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ 322 #endif // VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698