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

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

Issue 145033006: views: Make View::set_border() take a scoped_ptr<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 void DecoratedTextfield::UpdateBackground() { 132 void DecoratedTextfield::UpdateBackground() {
133 if (editable_) 133 if (editable_)
134 UseDefaultBackgroundColor(); 134 UseDefaultBackgroundColor();
135 else 135 else
136 SetBackgroundColor(SK_ColorTRANSPARENT); 136 SetBackgroundColor(SK_ColorTRANSPARENT);
137 set_background( 137 set_background(
138 views::Background::CreateSolidBackground(GetBackgroundColor())); 138 views::Background::CreateSolidBackground(GetBackgroundColor()));
139 } 139 }
140 140
141 void DecoratedTextfield::UpdateBorder() { 141 void DecoratedTextfield::UpdateBorder() {
142 views::FocusableBorder* border = new views::FocusableBorder(); 142 scoped_ptr<views::FocusableBorder> border(new views::FocusableBorder());
143 if (invalid_) 143 if (invalid_)
144 border->SetColor(kWarningColor); 144 border->SetColor(kWarningColor);
145 else if (!editable_) 145 else if (!editable_)
146 border->SetColor(SK_ColorTRANSPARENT); 146 border->SetColor(SK_ColorTRANSPARENT);
147 set_border(border); 147 SetBorder(border.PassAs<views::Border>());
148 } 148 }
149 149
150 void DecoratedTextfield::IconChanged() { 150 void DecoratedTextfield::IconChanged() {
151 // Don't show the icon if nothing else is showing. 151 // Don't show the icon if nothing else is showing.
152 icon_view_->SetVisible(editable_ || !text().empty()); 152 icon_view_->SetVisible(editable_ || !text().empty());
153 Layout(); 153 Layout();
154 } 154 }
155 155
156 } // namespace autofill 156 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/autofill/autofill_popup_base_view.cc ('k') | chrome/browser/ui/views/autofill/info_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698