OLD | NEW |
---|---|
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 UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 5 #ifndef UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
6 #define UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 6 #define UI_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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
56 virtual ~Textfield(); | 56 virtual ~Textfield(); |
57 | 57 |
58 // TextfieldController accessors | 58 // TextfieldController accessors |
59 void SetController(TextfieldController* controller); | 59 void SetController(TextfieldController* controller); |
60 TextfieldController* GetController() const; | 60 TextfieldController* GetController() const; |
61 | 61 |
62 // Gets/Sets whether or not the Textfield is read-only. | 62 // Gets/Sets whether or not the Textfield is read-only. |
63 bool read_only() const { return read_only_; } | 63 bool read_only() const { return read_only_; } |
64 void SetReadOnly(bool read_only); | 64 void SetReadOnly(bool read_only); |
65 | 65 |
66 // Gets/Sets whether or not this Textfield is a password field. | 66 // Gets whether or not this Textfield is a password field. This property |
67 // TODO(bryeung): Currently this is only used in | 67 // can be set by calling SetTextInputType. |
68 // chrome/browser/chromeos/options/wifi_config_view.cc, which is being | 68 bool IsPassword() const { |
69 // converted to WebUI. Please remove this when that happens. | 69 return style() & STYLE_PASSWORD; |
tfarina
2011/11/30 19:32:03
nit: please use style_ here directly. Also I'd pre
benrg
2011/11/30 19:54:24
This was one of my bullet points -- I wanted to ma
oshima
2011/12/01 22:08:22
This one should be in .cc
benrg
2011/12/01 23:36:16
Done.
| |
70 bool IsPassword() const; | 70 } |
71 void SetPassword(bool password); | |
72 | 71 |
73 // Gets/Sets the input type of this textfield. | 72 // Gets/Sets the input type of this textfield. |
74 ui::TextInputType GetTextInputType() const; | 73 ui::TextInputType GetTextInputType() const; |
75 void SetTextInputType(ui::TextInputType type); | 74 void SetTextInputType(ui::TextInputType type); |
76 | 75 |
77 // Gets/Sets the text currently displayed in the Textfield. | 76 // Gets/Sets the text currently displayed in the Textfield. |
78 const string16& text() const { return text_; } | 77 const string16& text() const { return text_; } |
79 | 78 |
80 // Sets the text currently displayed in the Textfield. This doesn't | 79 // Sets the text currently displayed in the Textfield. This doesn't |
81 // change the cursor position if the current cursor is within the | 80 // change the cursor position if the current cursor is within the |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
306 | 305 |
307 // The input type of this text field. | 306 // The input type of this text field. |
308 ui::TextInputType text_input_type_; | 307 ui::TextInputType text_input_type_; |
309 | 308 |
310 DISALLOW_COPY_AND_ASSIGN(Textfield); | 309 DISALLOW_COPY_AND_ASSIGN(Textfield); |
311 }; | 310 }; |
312 | 311 |
313 } // namespace views | 312 } // namespace views |
314 | 313 |
315 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ | 314 #endif // UI_VIEWS_CONTROLS_TEXTFIELD_TEXTFIELD_H_ |
OLD | NEW |