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

Unified Diff: chrome/browser/ui/views/autofill/password_generation_popup_view_views.cc

Issue 2790953002: Fix calculation of Password Generation popup. (Closed)
Patch Set: Nit Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/autofill/password_generation_popup_view_views.cc
diff --git a/chrome/browser/ui/views/autofill/password_generation_popup_view_views.cc b/chrome/browser/ui/views/autofill/password_generation_popup_view_views.cc
index 052cdce19032b264b35a784d9dbc99a4bd7ee380..addc3e0e9a2734b44e38d2967e0aa64b8189c6ab 100644
--- a/chrome/browser/ui/views/autofill/password_generation_popup_view_views.cc
+++ b/chrome/browser/ui/views/autofill/password_generation_popup_view_views.cc
@@ -177,16 +177,17 @@ void PasswordGenerationPopupViewViews::CreatePasswordView() {
}
gfx::Size PasswordGenerationPopupViewViews::GetPreferredSizeOfPasswordView() {
- int height = kPopupBorderThickness;
+ int width = controller_->GetMinimumWidth();
+ if (password_view_)
+ width = std::max(width, password_view_->GetMinimumSize().width());
+ int height = help_label_->GetHeightForWidth(width);
if (controller_->display_password()) {
// Add divider height as well.
height +=
PasswordGenerationPopupController::kPopupPasswordSectionHeight + 1;
}
- int width = controller_->GetMinimumWidth();
- int popup_width = width - 2 * kPopupBorderThickness;
- height += help_label_->GetHeightForWidth(popup_width);
- return gfx::Size(width, height + kPopupBorderThickness);
+ return gfx::Size(width + 2 * kPopupBorderThickness,
+ height + 2 * kPopupBorderThickness);
}
void PasswordGenerationPopupViewViews::Show() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698