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

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

Issue 1522563002: Modernize autofill popup design (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
Index: chrome/browser/ui/views/autofill/autofill_popup_view_views.cc
diff --git a/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc b/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc
index 2fa7ba5d84a0f4b331f0435a4bb0e8783ffe1383..b26492226bcc4b5be0980d656297d451f8efa0b8 100644
--- a/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc
+++ b/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc
@@ -7,6 +7,7 @@
#include "chrome/browser/ui/autofill/autofill_popup_controller.h"
#include "components/autofill/core/browser/popup_item_ids.h"
#include "components/autofill/core/browser/suggestion.h"
+#include "ui/base/resource/material_design/material_design_controller.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/gfx/canvas.h"
@@ -72,11 +73,14 @@ void AutofillPopupViewViews::DrawAutofillEntry(gfx::Canvas* canvas,
if (controller_->selected_line() == index)
canvas->FillRect(entry_rect, kHoveredBackgroundColor);
+ int end_padding = ui::MaterialDesignController::IsModeMaterial()
+ ? kMaterialEndPadding
+ : kEndPadding;
const bool is_rtl = controller_->IsRTL();
const int text_align =
is_rtl ? gfx::Canvas::TEXT_ALIGN_RIGHT : gfx::Canvas::TEXT_ALIGN_LEFT;
gfx::Rect value_rect = entry_rect;
- value_rect.Inset(kEndPadding, 0);
+ value_rect.Inset(end_padding, 0);
canvas->DrawStringRectWithFlags(
controller_->GetElidedValueAt(index),
controller_->GetValueFontListForRow(index),
@@ -84,7 +88,7 @@ void AutofillPopupViewViews::DrawAutofillEntry(gfx::Canvas* canvas,
value_rect, text_align);
// Use this to figure out where all the other Autofill items should be placed.
- int x_align_left = is_rtl ? kEndPadding : entry_rect.right() - kEndPadding;
+ int x_align_left = is_rtl ? end_padding : entry_rect.right() - end_padding;
// Draw the Autofill icon, if one exists
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();

Powered by Google App Engine
This is Rietveld 408576698