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

Unified Diff: chrome/browser/autofill/autofill_popup_view.cc

Issue 11189093: Skip Unacceptable Items in new Autofill UI when Navigating with Keys. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 months 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
« no previous file with comments | « chrome/browser/autofill/autofill_popup_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/autofill_popup_view.cc
diff --git a/chrome/browser/autofill/autofill_popup_view.cc b/chrome/browser/autofill/autofill_popup_view.cc
index 0ca2bd4d2cbeb07afdb259da6b41c1adb99fb149..0455348a626d0e6cbddbb46a8b64d8ea44ecdc3d 100644
--- a/chrome/browser/autofill/autofill_popup_view.cc
+++ b/chrome/browser/autofill/autofill_popup_view.cc
@@ -136,6 +136,12 @@ void AutofillPopupView::ClearSelectedLine() {
void AutofillPopupView::SelectNextLine() {
int new_selected_line = selected_line_ + 1;
+ // Skip over any lines that can't be selected.
+ while (static_cast<size_t>(new_selected_line) < autofill_values_.size() &&
+ !CanAccept(autofill_unique_ids()[new_selected_line])) {
+ ++new_selected_line;
+ }
+
if (new_selected_line == static_cast<int>(autofill_values_.size()))
new_selected_line = 0;
@@ -145,6 +151,12 @@ void AutofillPopupView::SelectNextLine() {
void AutofillPopupView::SelectPreviousLine() {
int new_selected_line = selected_line_ - 1;
+ // Skip over any lines that can't be selected.
+ while (new_selected_line > kNoSelection &&
+ !CanAccept(autofill_unique_ids()[new_selected_line])) {
+ --new_selected_line;
+ }
+
if (new_selected_line <= kNoSelection)
new_selected_line = autofill_values_.size() - 1;
« no previous file with comments | « chrome/browser/autofill/autofill_popup_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698