Chromium Code Reviews| 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 532bbf9cf4dce5afcf2cb5003d3833785e95051d..31c21679300121499112efe7433b6277f9279498 100644 |
| --- a/chrome/browser/ui/autofill/autofill_popup_layout_model.cc |
| +++ b/chrome/browser/ui/autofill/autofill_popup_layout_model.cc |
| @@ -111,11 +111,13 @@ 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 == |
| + 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; |
| @@ -123,7 +125,8 @@ int AutofillPopupLayoutModel::RowWidthWithoutText(int row, |
| int icon_width = ui::ResourceBundle::GetSharedInstance() |
| .GetImageNamed(GetIconResourceID(icon)) |
| .Width(); |
| - row_size += icon_width + kIconPadding; |
| + row_size += isWarningMessage ? icon_width + kHttpWarningIconPadding |
| + : icon_width + kIconPadding; |
| } |
| // Add the padding at the end. |
| @@ -179,7 +182,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(); |
| + PopupItemId id = static_cast<PopupItemId>(suggestions[index].frontend_id); |
| + if (id == POPUP_ITEM_ID_HTTP_NOT_SECURE_WARNING_MESSAGE) |
|
Mathieu
2016/11/22 14:36:45
curious, can't you do
if (suggestions[index].fron
lshang
2016/11/27 04:59:13
Done.
|
| + return normal_font_list_; |
| + |
| return smaller_font_list_; |
| } |