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

Side by Side Diff: chrome/browser/ui/autofill/autofill_popup_controller_impl.cc

Issue 148413002: Add "previewing on hover" support for single-field autocomplete input (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and update code as per Ilya's comments Created 6 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h" 5 #include "chrome/browser/ui/autofill/autofill_popup_controller_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 431
432 if (selected_line_ != kNoSelection && 432 if (selected_line_ != kNoSelection &&
433 static_cast<size_t>(selected_line_) < identifiers_.size()) 433 static_cast<size_t>(selected_line_) < identifiers_.size())
434 InvalidateRow(selected_line_); 434 InvalidateRow(selected_line_);
435 435
436 if (selected_line != kNoSelection) 436 if (selected_line != kNoSelection)
437 InvalidateRow(selected_line); 437 InvalidateRow(selected_line);
438 438
439 selected_line_ = selected_line; 439 selected_line_ = selected_line;
440 440
441 if (selected_line_ != kNoSelection) 441 if (selected_line_ != kNoSelection) {
442 delegate_->DidSelectSuggestion(identifiers_[selected_line_]); 442 delegate_->DidSelectSuggestion(names_[selected_line_],
443 else 443 identifiers_[selected_line_]);
444 } else {
444 delegate_->ClearPreviewedForm(); 445 delegate_->ClearPreviewedForm();
446 }
445 } 447 }
446 448
447 void AutofillPopupControllerImpl::SelectNextLine() { 449 void AutofillPopupControllerImpl::SelectNextLine() {
448 int new_selected_line = selected_line_ + 1; 450 int new_selected_line = selected_line_ + 1;
449 451
450 // Skip over any lines that can't be selected. 452 // Skip over any lines that can't be selected.
451 while (static_cast<size_t>(new_selected_line) < names_.size() && 453 while (static_cast<size_t>(new_selected_line) < names_.size() &&
452 !CanAccept(identifiers()[new_selected_line])) { 454 !CanAccept(identifiers()[new_selected_line])) {
453 ++new_selected_line; 455 ++new_selected_line;
454 } 456 }
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 names_.clear(); 647 names_.clear();
646 subtexts_.clear(); 648 subtexts_.clear();
647 icons_.clear(); 649 icons_.clear();
648 identifiers_.clear(); 650 identifiers_.clear();
649 full_names_.clear(); 651 full_names_.clear();
650 652
651 selected_line_ = kNoSelection; 653 selected_line_ = kNoSelection;
652 } 654 }
653 655
654 } // namespace autofill 656 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698