Chromium Code Reviews| Index: chrome/browser/ui/autofill/autofill_popup_controller_impl.cc |
| diff --git a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc |
| index 72e6c2b13c7e0e5130b93fa8cd6b2cd77fb03810..7ab2e2ebb4b38d4e9b2edc7831e59824dfe67b37 100644 |
| --- a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc |
| +++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc |
| @@ -118,6 +118,7 @@ AutofillPopupControllerImpl::AutofillPopupControllerImpl( |
| #else |
| warning_font_list_ = name_font_list_.DeriveWithStyle(gfx::Font::ITALIC); |
| #endif |
| + title_font_list_ = name_font_list_.DeriveWithStyle(gfx::Font::BOLD); |
| #endif |
| } |
| @@ -260,7 +261,7 @@ bool AutofillPopupControllerImpl::HandleKeyPressEvent( |
| SelectNextLine(); |
| return true; |
| case ui::VKEY_PRIOR: // Page up. |
| - SetSelectedLine(0); |
| + SetSelectedLine(GetFirstSelectableLine()); |
|
Garrett Casto
2014/11/23 07:49:48
It might not be possible now, but I would think th
jww
2014/11/25 02:46:26
Done.
|
| return true; |
| case ui::VKEY_NEXT: // Page down. |
| SetSelectedLine(names().size() - 1); |
| @@ -405,6 +406,9 @@ const gfx::FontList& AutofillPopupControllerImpl::GetNameFontListForRow( |
| if (identifiers_[index] == POPUP_ITEM_ID_WARNING_MESSAGE) |
| return warning_font_list_; |
| + if (identifiers_[index] == POPUP_ITEM_ID_TITLE) |
| + return title_font_list_; |
| + |
| return name_font_list_; |
| } |
| @@ -421,6 +425,10 @@ void AutofillPopupControllerImpl::SetSelectedLine(int selected_line) { |
| if (selected_line_ == selected_line) |
| return; |
| + if (selected_line != kNoSelection && identifiers_.size() > 0 && |
| + identifiers_[selected_line] == POPUP_ITEM_ID_TITLE) |
| + return; |
| + |
| if (selected_line_ != kNoSelection && |
| static_cast<size_t>(selected_line_) < identifiers_.size()) |
| InvalidateRow(selected_line_); |
| @@ -522,7 +530,8 @@ int AutofillPopupControllerImpl::GetRowHeightFromId(int identifier) const { |
| } |
| bool AutofillPopupControllerImpl::CanAccept(int id) { |
| - return id != POPUP_ITEM_ID_SEPARATOR && id != POPUP_ITEM_ID_WARNING_MESSAGE; |
| + return id != POPUP_ITEM_ID_SEPARATOR && id != POPUP_ITEM_ID_WARNING_MESSAGE && |
| + id != POPUP_ITEM_ID_TITLE; |
| } |
| bool AutofillPopupControllerImpl::HasSuggestions() { |
| @@ -632,4 +641,11 @@ void AutofillPopupControllerImpl::ClearState() { |
| selected_line_ = kNoSelection; |
| } |
| +int AutofillPopupControllerImpl::GetFirstSelectableLine() { |
| + if (identifiers().size() < 1 || identifiers()[0] != POPUP_ITEM_ID_TITLE) |
| + return 0; |
| + |
| + return 1; |
| +} |
| + |
| } // namespace autofill |