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

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

Issue 2694183005: Ensure autofill popup border is visible (Closed)
Patch Set: fixes Created 3 years, 10 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/password_generation_popup_view_views. h" 5 #include "chrome/browser/ui/views/autofill/password_generation_popup_view_views. h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "chrome/app/vector_icons/vector_icons.h" 9 #include "chrome/app/vector_icons/vector_icons.h"
10 #include "chrome/browser/ui/autofill/password_generation_popup_controller.h" 10 #include "chrome/browser/ui/autofill/password_generation_popup_controller.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 views::Background::CreateSolidBackground( 214 views::Background::CreateSolidBackground(
215 GetNativeTheme()->GetSystemColor( 215 GetNativeTheme()->GetSystemColor(
216 controller_->password_selected() ? 216 controller_->password_selected() ?
217 ui::NativeTheme::kColorId_ResultsTableHoveredBackground : 217 ui::NativeTheme::kColorId_ResultsTableHoveredBackground :
218 ui::NativeTheme::kColorId_ResultsTableNormalBackground))); 218 ui::NativeTheme::kColorId_ResultsTableNormalBackground)));
219 } 219 }
220 220
221 void PasswordGenerationPopupViewViews::Layout() { 221 void PasswordGenerationPopupViewViews::Layout() {
222 // Need to leave room for the border. 222 // Need to leave room for the border.
223 int y = kPopupBorderThickness; 223 int y = kPopupBorderThickness;
224 int popup_width = bounds().width() - 2 * kPopupBorderThickness; 224 int popup_width = GetPopupBounds().width() - 2 * kPopupBorderThickness;
225 if (controller_->display_password()) { 225 if (controller_->display_password()) {
226 // Currently the UI can change from not offering a password to offering 226 // Currently the UI can change from not offering a password to offering
227 // a password (e.g. the user is editing a generated password and deletes 227 // a password (e.g. the user is editing a generated password and deletes
228 // it), but it can't change the other way around. 228 // it), but it can't change the other way around.
229 CreatePasswordView(); 229 CreatePasswordView();
230 password_view_->SetBounds( 230 password_view_->SetBounds(
231 kPopupBorderThickness, 231 kPopupBorderThickness,
232 y, 232 y,
233 popup_width, 233 popup_width,
234 PasswordGenerationPopupController::kPopupPasswordSectionHeight); 234 PasswordGenerationPopupController::kPopupPasswordSectionHeight);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 return new PasswordGenerationPopupViewViews(controller, observing_widget); 283 return new PasswordGenerationPopupViewViews(controller, observing_widget);
284 } 284 }
285 285
286 void PasswordGenerationPopupViewViews::GetAccessibleNodeData( 286 void PasswordGenerationPopupViewViews::GetAccessibleNodeData(
287 ui::AXNodeData* node_data) { 287 ui::AXNodeData* node_data) {
288 node_data->SetName(controller_->SuggestedText()); 288 node_data->SetName(controller_->SuggestedText());
289 node_data->role = ui::AX_ROLE_MENU_ITEM; 289 node_data->role = ui::AX_ROLE_MENU_ITEM;
290 } 290 }
291 291
292 } // namespace autofill 292 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698