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

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: update 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..1b24397deb34abe28169891bfd150173fe235080 100644
--- a/chrome/browser/ui/autofill/autofill_popup_layout_model.cc
+++ b/chrome/browser/ui/autofill/autofill_popup_layout_model.cc
@@ -15,6 +15,7 @@
#include "components/autofill/core/common/autofill_util.h"
#include "components/grit/components_scaled_resources.h"
#include "ui/base/resource/resource_bundle.h"
+#include "ui/gfx/color_palette.h"
#include "ui/gfx/font_list.h"
#include "ui/gfx/geometry/rect_conversions.h"
@@ -157,13 +158,14 @@ 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_CLEAR_FORM:
case POPUP_ITEM_ID_CREDIT_CARD_SIGNIN_PROMO:
case POPUP_ITEM_ID_AUTOFILL_OPTIONS:
case POPUP_ITEM_ID_SCAN_CREDIT_CARD:
case POPUP_ITEM_ID_SEPARATOR:
+ case POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE:
return normal_font_list_;
case POPUP_ITEM_ID_TITLE:
case POPUP_ITEM_ID_AUTOCOMPLETE_ENTRY:
@@ -178,6 +180,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) {
+ case POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE:
+ return gfx::kGoogleRed700;
+ case POPUP_ITEM_ID_INSECURE_CONTEXT_PAYMENT_DISABLED_MESSAGE:
+ return kLabelTextColor;
+ default:
+ return kValueTextColor;
+ }
+}
#endif
int AutofillPopupLayoutModel::LineFromY(int y) const {
« no previous file with comments | « chrome/browser/ui/autofill/autofill_popup_layout_model.h ('k') | chrome/browser/ui/autofill/popup_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698