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

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

Issue 135863002: Reland Merge NativeTextfieldViews into views::Textfield. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Handle Ctrl-Shift-Delete and Backspace on Linux, like on ChromeOS. 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 icon->SetX(start_x); 201 icon->SetX(start_x);
202 icon->SetY(bounds.y() + 202 icon->SetY(bounds.y() +
203 (bounds.height() - icon->bounds().height()) / 2); 203 (bounds.height() - icon->bounds().height()) / 2);
204 start_x += icon->bounds().width() + kAroundTextPadding; 204 start_x += icon->bounds().width() + kAroundTextPadding;
205 } 205 }
206 206
207 // Textfield is right aligned. 207 // Textfield is right aligned.
208 int end_x = bounds.width(); 208 int end_x = bounds.width();
209 views::View* decorated = child_at(2); 209 views::View* decorated = child_at(2);
210 if (decorated->visible()) { 210 if (decorated->visible()) {
211 decorated->SizeToPreferredSize(); 211 const int preferred_width = decorated->GetPreferredSize().width();
212 decorated->SetX(bounds.width() - decorated->bounds().width()); 212 decorated->SetBounds(bounds.width() - preferred_width, bounds.y(),
213 decorated->SetY(bounds.y()); 213 preferred_width, bounds.height());
214 end_x = decorated->bounds().x() - kAroundTextPadding; 214 end_x = decorated->bounds().x() - kAroundTextPadding;
215 } 215 }
216 216
217 // Label takes up all the space in between. 217 // Label takes up all the space in between.
218 views::View* label = child_at(1); 218 views::View* label = child_at(1);
219 if (label->visible()) 219 if (label->visible())
220 label->SetBounds(start_x, bounds.y(), end_x - start_x, bounds.height()); 220 label->SetBounds(start_x, bounds.y(), end_x - start_x, bounds.height());
221 221
222 views::View::Layout(); 222 views::View::Layout();
223 } 223 }
(...skipping 2241 matching lines...) Expand 10 before | Expand all | Expand 10 after
2465 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section) 2465 AutofillDialogViews::DetailsGroup::DetailsGroup(DialogSection section)
2466 : section(section), 2466 : section(section),
2467 container(NULL), 2467 container(NULL),
2468 manual_input(NULL), 2468 manual_input(NULL),
2469 suggested_info(NULL), 2469 suggested_info(NULL),
2470 suggested_button(NULL) {} 2470 suggested_button(NULL) {}
2471 2471
2472 AutofillDialogViews::DetailsGroup::~DetailsGroup() {} 2472 AutofillDialogViews::DetailsGroup::~DetailsGroup() {}
2473 2473
2474 } // namespace autofill 2474 } // 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