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

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

Issue 2971783002: Skeleton for showing "Show all saved passwords row" for Linux/CrOs/Windows platforms (Closed)
Patch Set: . Created 3 years, 5 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
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 ad9bd1d676f707874ef91c809544bfbe8ca8efab..48fcac1cc175e5572558c984dd6084449768c5d4 100644
--- a/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc
+++ b/chrome/browser/ui/views/autofill/autofill_popup_view_views.cc
@@ -150,9 +150,12 @@ void AutofillPopupViewViews::DrawAutofillEntry(gfx::Canvas* canvas,
GetNativeTheme()->GetSystemColor(
controller_->GetBackgroundColorIDForRow(index)));
+ const int frontend_id = controller_->GetSuggestionAt(index).frontend_id;
const bool is_http_warning =
- (controller_->GetSuggestionAt(index).frontend_id ==
- POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE);
+ (frontend_id == POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE);
+ const bool icon_in_front_of_text =
+ (is_http_warning ||
+ frontend_id == POPUP_ITEM_ID_ALL_SAVED_PASSWORDS_ENTRY);
const bool is_rtl = controller_->IsRTL();
const int text_align =
is_rtl ? gfx::Canvas::TEXT_ALIGN_RIGHT : gfx::Canvas::TEXT_ALIGN_LEFT;
@@ -160,7 +163,7 @@ void AutofillPopupViewViews::DrawAutofillEntry(gfx::Canvas* canvas,
value_rect.Inset(AutofillPopupLayoutModel::kEndPadding, 0);
// If the icon is on the right of the rect, no matter in RTL or LTR mode.
- bool icon_on_the_right = is_http_warning == is_rtl;
+ bool icon_on_the_right = icon_in_front_of_text == is_rtl;
int x_align_left = icon_on_the_right ? value_rect.right() : value_rect.x();
// Draw the Autofill icon, if one exists
@@ -176,12 +179,12 @@ void AutofillPopupViewViews::DrawAutofillEntry(gfx::Canvas* canvas,
canvas->DrawImageInt(image, icon_x_align_left, icon_y);
// An icon was drawn; adjust the |x_align_left| value for the next element.
- if (is_http_warning) {
+ if (icon_in_front_of_text) {
x_align_left =
icon_x_align_left +
- (is_rtl ? -AutofillPopupLayoutModel::kHttpWarningIconPadding
+ (is_rtl ? -AutofillPopupLayoutModel::kPaddingAfterLeadingIcon
: image.width() +
- AutofillPopupLayoutModel::kHttpWarningIconPadding);
+ AutofillPopupLayoutModel::kPaddingAfterLeadingIcon);
} else {
x_align_left =
icon_x_align_left +
@@ -196,7 +199,7 @@ void AutofillPopupViewViews::DrawAutofillEntry(gfx::Canvas* canvas,
controller_->layout_model().GetValueFontListForRow(index));
int value_x_align_left = x_align_left;
- if (is_http_warning) {
+ if (icon_in_front_of_text) {
value_x_align_left += is_rtl ? -value_width : 0;
} else {
value_x_align_left =
« no previous file with comments | « chrome/browser/ui/autofill/chrome_autofill_client.cc ('k') | components/autofill/core/browser/autofill_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698