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

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

Issue 657333002: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 // Adjust the border insets to include the icon and its padding. 156 // Adjust the border insets to include the icon and its padding.
157 if (icon_view_ && icon_view_->visible()) { 157 if (icon_view_ && icon_view_->visible()) {
158 int w = icon_view_->GetPreferredSize().width() + 2 * kTextfieldIconPadding; 158 int w = icon_view_->GetPreferredSize().width() + 2 * kTextfieldIconPadding;
159 gfx::Insets insets = border->GetInsets(); 159 gfx::Insets insets = border->GetInsets();
160 int left = insets.left() + (base::i18n::IsRTL() ? w : 0); 160 int left = insets.left() + (base::i18n::IsRTL() ? w : 0);
161 int right = insets.right() + (base::i18n::IsRTL() ? 0 : w); 161 int right = insets.right() + (base::i18n::IsRTL() ? 0 : w);
162 border->SetInsets(insets.top(), left, insets.bottom(), right); 162 border->SetInsets(insets.top(), left, insets.bottom(), right);
163 } 163 }
164 164
165 SetBorder(border.PassAs<views::Border>()); 165 SetBorder(border.Pass());
166 } 166 }
167 167
168 void DecoratedTextfield::IconChanged() { 168 void DecoratedTextfield::IconChanged() {
169 // Don't show the icon if nothing else is showing. 169 // Don't show the icon if nothing else is showing.
170 icon_view_->SetVisible(editable_ || !text().empty()); 170 icon_view_->SetVisible(editable_ || !text().empty());
171 UpdateBorder(); 171 UpdateBorder();
172 Layout(); 172 Layout();
173 } 173 }
174 174
175 } // namespace autofill 175 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/ui/tabs/tab_utils.cc ('k') | chrome/browser/ui/views/desktop_media_picker_views_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698