OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |