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

Unified Diff: chrome/browser/ui/autofill/autofill_popup_controller_impl.cc

Issue 2152243002: [Autofill] Tweak credit card signin promo visually. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: transparent color Created 4 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/autofill/autofill_popup_controller_impl.cc
diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
index 2922e94325da96bb636dd8750d61cfda6907f0b6..5388875a8fdd7aa8ccbfde61a9f7cfd95900404c 100644
--- a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
@@ -13,6 +13,7 @@
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/ui/autofill/autofill_popup_view.h"
+#include "chrome/browser/ui/autofill/popup_constants.h"
#include "components/autofill/core/browser/autofill_popup_delegate.h"
#include "components/autofill/core/browser/popup_item_ids.h"
#include "components/autofill/core/browser/suggestion.h"
@@ -408,8 +409,9 @@ const gfx::FontList& AutofillPopupControllerImpl::GetValueFontListForRow(
case POPUP_ITEM_ID_AUTOFILL_OPTIONS:
case POPUP_ITEM_ID_SCAN_CREDIT_CARD:
case POPUP_ITEM_ID_SEPARATOR:
- case POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO:
return normal_font_list_;
+ case POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO:
+ return smaller_font_list_;
case POPUP_ITEM_ID_TITLE:
case POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY:
case POPUP_ITEM_ID_DATALIST_ENTRY:
@@ -425,6 +427,18 @@ const gfx::FontList& AutofillPopupControllerImpl::GetLabelFontList() const {
}
#endif
+SkColor AutofillPopupControllerImpl::GetBackgroundColorForRow(int index) const {
+ if (index == selected_line_) {
Evan Stade 2016/07/18 18:13:08 nit: no curlies
Mathieu 2016/07/18 18:45:12 Done.
+ return kHoveredBackgroundColor;
+ }
+ if (suggestions_[index].frontend_id ==
+ POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO) {
+ return kPromoPopupBackground;
+ }
+
+ return SK_ColorTRANSPARENT;
+}
+
int AutofillPopupControllerImpl::selected_line() const {
return selected_line_;
}

Powered by Google App Engine
This is Rietveld 408576698