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

Side by Side Diff: chrome/browser/ui/views/autofill/decorated_textfield.cc

Issue 138363004: Views Textfield fixes and cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync and rebase. Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/edit_search_engine_dialog.cc ('k') | chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698