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

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

Issue 120503005: Merge NativeTextfieldViews into views::Textfield. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simplify Textfield border code. 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/autofill/decorated_textfield.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/autofill_dialog_views.h" 5 #include "chrome/browser/ui/views/autofill/autofill_dialog_views.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 icon->SetX(start_x); 200 icon->SetX(start_x);
201 icon->SetY(bounds.y() + 201 icon->SetY(bounds.y() +
202 (bounds.height() - icon->bounds().height()) / 2); 202 (bounds.height() - icon->bounds().height()) / 2);
203 start_x += icon->bounds().width() + kAroundTextPadding; 203 start_x += icon->bounds().width() + kAroundTextPadding;
204 } 204 }
205 205
206 // Textfield is right aligned. 206 // Textfield is right aligned.
207 int end_x = bounds.width(); 207 int end_x = bounds.width();
208 views::View* decorated = child_at(2); 208 views::View* decorated = child_at(2);
209 if (decorated->visible()) { 209 if (decorated->visible()) {
210 decorated->SizeToPreferredSize(); 210 const int preferred_width = decorated->GetPreferredSize().width();
211 decorated->SetX(bounds.width() - decorated->bounds().width()); 211 decorated->SetBounds(bounds.width() - preferred_width, bounds.y(),
212 decorated->SetY(bounds.y()); 212 preferred_width, bounds.height());
213 end_x = decorated->bounds().x() - kAroundTextPadding; 213 end_x = decorated->bounds().x() - kAroundTextPadding;
214 } 214 }
215 215
216 // Label takes up all the space in between. 216 // Label takes up all the space in between.
217 views::View* label = child_at(1); 217 views::View* label = child_at(1);
218 if (label->visible()) 218 if (label->visible())
219 label->SetBounds(start_x, bounds.y(), end_x - start_x, bounds.height()); 219 label->SetBounds(start_x, bounds.y(), end_x - start_x, bounds.height());
220 220
221 views::View::Layout(); 221 views::View::Layout();
222 } 222 }
(...skipping 2226 matching lines...) Expand 10 before | Expand all | Expand 10 after
2449 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) 2449 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section)
2450 : section(section), 2450 : section(section),
2451 container(NULL), 2451 container(NULL),
2452 manual_input(NULL), 2452 manual_input(NULL),
2453 suggested_info(NULL), 2453 suggested_info(NULL),
2454 suggested_button(NULL) {} 2454 suggested_button(NULL) {}
2455 2455
2456 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} 2456 AutofillDialogViews::DetailsGroup::~DetailsGroup() {}
2457 2457
2458 } // namespace autofill 2458 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/autofill/decorated_textfield.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698