OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "chrome/browser/ui/views/autofill/decorated_textfield.h" | 5 #include "chrome/browser/ui/views/autofill/decorated_textfield.h" |
6 | 6 |
7 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" | 7 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" |
8 #include "chrome/browser/ui/views/autofill/tooltip_icon.h" | 8 #include "chrome/browser/ui/views/autofill/tooltip_icon.h" |
9 #include "ui/gfx/canvas.h" | 9 #include "ui/gfx/canvas.h" |
10 #include "ui/views/background.h" | 10 #include "ui/views/background.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 const base::string16& default_value, | 28 const base::string16& default_value, |
29 const base::string16& placeholder, | 29 const base::string16& placeholder, |
30 views::TextfieldController* controller) | 30 views::TextfieldController* controller) |
31 : invalid_(false), | 31 : invalid_(false), |
32 editable_(true) { | 32 editable_(true) { |
33 UpdateBackground(); | 33 UpdateBackground(); |
34 UpdateBorder(); | 34 UpdateBorder(); |
35 | 35 |
36 set_placeholder_text(placeholder); | 36 set_placeholder_text(placeholder); |
37 SetText(default_value); | 37 SetText(default_value); |
38 SetController(controller); | 38 set_controller(controller); |
39 } | 39 } |
40 | 40 |
41 DecoratedTextfield::~DecoratedTextfield() {} | 41 DecoratedTextfield::~DecoratedTextfield() {} |
42 | 42 |
43 void DecoratedTextfield::SetInvalid(bool invalid) { | 43 void DecoratedTextfield::SetInvalid(bool invalid) { |
44 if (invalid_ == invalid) | 44 if (invalid_ == invalid) |
45 return; | 45 return; |
46 | 46 |
47 invalid_ = invalid; | 47 invalid_ = invalid; |
48 UpdateBorder(); | 48 UpdateBorder(); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 const bool visible = editable_ || !text().empty(); | 161 const bool visible = editable_ || !text().empty(); |
162 if (icon_view_->visible() == visible) | 162 if (icon_view_->visible() == visible) |
163 return; | 163 return; |
164 | 164 |
165 icon_view_->SetVisible(visible); | 165 icon_view_->SetVisible(visible); |
166 UpdateBorder(); | 166 UpdateBorder(); |
167 SchedulePaint(); | 167 SchedulePaint(); |
168 } | 168 } |
169 | 169 |
170 } // namespace autofill | 170 } // namespace autofill |
OLD | NEW |