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

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

Issue 2517843002: Http Bad: Put icon on the left of http warning message on Views (Closed)
Patch Set: fix mac Created 4 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/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 b689fec51b41b9cdce8dc16aa4d3084bfd2b392b..5364cb6130d7ab676b29b1076e67bb330b6e667f 100644
--- a/chrome/browser/ui/autofill/autofill_popup_layout_model.cc
+++ b/chrome/browser/ui/autofill/autofill_popup_layout_model.cc
@@ -118,16 +118,19 @@ int AutofillPopupLayoutModel::GetDesiredPopupWidth() const {
int AutofillPopupLayoutModel::RowWidthWithoutText(int row,
bool with_label) const {
std::vector<autofill::Suggestion> suggestions = delegate_->GetSuggestions();
+ bool is_warning_message = (suggestions[row].frontend_id ==
+ POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE);
int row_size = kEndPadding;
if (with_label)
- row_size += kNamePadding;
+ row_size += is_warning_message ? kHttpWarningNamePadding : kNamePadding;
// Add the Autofill icon size, if required.
const base::string16& icon = suggestions[row].icon;
if (!icon.empty()) {
- row_size += GetIconImage(row).width() + kIconPadding;
+ row_size += GetIconImage(row).width() +
+ (is_warning_message ? kHttpWarningIconPadding : kIconPadding);
}
// Add the padding at the end.
@@ -183,7 +186,13 @@ const gfx::FontList& AutofillPopupLayoutModel::GetValueFontListForRow(
return normal_font_list_;
}
-const gfx::FontList& AutofillPopupLayoutModel::GetLabelFontList() const {
+const gfx::FontList& AutofillPopupLayoutModel::GetLabelFontListForRow(
+ size_t index) const {
+ std::vector<autofill::Suggestion> suggestions = delegate_->GetSuggestions();
+ if (suggestions[index].frontend_id ==
+ POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE)
+ return normal_font_list_;
+
return smaller_font_list_;
}

Powered by Google App Engine
This is Rietveld 408576698