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

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: add comments 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 e10cfc6eee90f1c0c97f873b93ee50fadcd7d67f..321c68fe46e5835a57974a125037f05fd956bded 100644
--- a/chrome/browser/ui/autofill/autofill_popup_layout_model.cc
+++ b/chrome/browser/ui/autofill/autofill_popup_layout_model.cc
@@ -117,17 +117,20 @@ int AutofillPopupLayoutModel::GetDesiredPopupWidth() const {
int AutofillPopupLayoutModel::RowWidthWithoutText(int row,
bool with_label) const {
std::vector<autofill::Suggestion> suggestions = delegate_->GetSuggestions();
+ bool isWarningMessage = (suggestions[row].frontend_id ==
Evan Stade 2016/11/29 15:43:17 is_warning_message
lshang 2016/11/30 05:43:36 Done.
+ POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE);
int row_size = kEndPadding;
if (with_label)
- row_size += kNamePadding;
+ row_size += isWarningMessage ? kHttpWarningNamePadding : kNamePadding;
// Add the Autofill icon size, if required.
const base::string16& icon = suggestions[row].icon;
if (!icon.empty()) {
int icon_width = GetIconImage(row).width();
- row_size += icon_width + kIconPadding;
+ row_size += isWarningMessage ? icon_width + kHttpWarningIconPadding
Evan Stade 2016/11/29 15:43:17 nit: row_size += icon_width + (is_warning ? kHttp
lshang 2016/11/30 05:43:36 Done.
+ : icon_width + 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