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

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

Issue 2496683003: Http Bad: Add a PopupItemId to identify http warning message (Closed)
Patch Set: minor change Created 4 years, 1 month 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_layout_model.cc
diff --git a/chrome/browser/ui/autofill/autofill_popup_layout_model.cc b/chrome/browser/ui/autofill/autofill_popup_layout_model.cc
index 652017dcad23f5abd8fcc87a074a9c2d05977094..ce12f2b0fd421b4ca205de2dd7e472b8b25344cd 100644
--- a/chrome/browser/ui/autofill/autofill_popup_layout_model.cc
+++ b/chrome/browser/ui/autofill/autofill_popup_layout_model.cc
@@ -157,8 +157,9 @@ const gfx::FontList& AutofillPopupLayoutModel::GetValueFontListForRow(
// All other message types are defined here.
PopupItemId id = static_cast<PopupItemId>(suggestions[index].frontend_id);
switch (id) {
- case POPUP_ITEM_ID_WARNING_MESSAGE:
+ case POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE:
return warning_font_list_;
+ case POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE:
case POPUP_ITEM_ID_CLEAR_FORM:
case POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO:
case POPUP_ITEM_ID_AUTOFILL_OPTIONS:
@@ -178,6 +179,18 @@ const gfx::FontList& AutofillPopupLayoutModel::GetValueFontListForRow(
const gfx::FontList& AutofillPopupLayoutModel::GetLabelFontList() const {
return smaller_font_list_;
}
+
+SkColor AutofillPopupLayoutModel::GetValueFontColorForRow(size_t index) const {
+ std::vector<autofill::Suggestion> suggestions = delegate_->GetSuggestions();
+ switch (suggestions[index].frontend_id) {
csashi 2016/11/17 01:41:31 Because you only need the frontend_id would it be
lshang 2016/11/17 07:03:46 Yes GetSuggestions() is used all over this file to
+ case POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE:
+ return kHttpWarningTextColor;
+ case POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE:
+ return kLabelTextColor;
+ default:
+ return kValueTextColor;
+ }
+}
#endif
int AutofillPopupLayoutModel::LineFromY(int y) const {

Powered by Google App Engine
This is Rietveld 408576698