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

Unified 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: Stated that no-op for new Autocomplete functions in autofill dialog file. Created 6 years, 11 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
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 e7cc9dd6b46a241a090f50647f025f7c66854df6..d4d3d99b94cbce95d21d715b35e3a16b5fcbf678 100644
--- a/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_popup_controller_impl.cc
@@ -446,10 +446,17 @@ void AutofillPopupControllerImpl::SetSelectedLine(int selected_line) {
selected_line_ = selected_line;
- if (selected_line_ != kNoSelection)
- delegate_->DidSelectSuggestion(identifiers_[selected_line_]);
- else
+ if (selected_line_ != kNoSelection) {
+ if ((identifiers_[selected_line_] ==
+ WebAutofillClient::MenuItemIDAutocompleteEntry) &&
+ (selected_line_ < static_cast<int>(names_.size())))
Ilya Sherman 2014/02/14 02:22:28 nit: No need for the extra parens around the compo
Ilya Sherman 2014/02/14 02:22:28 Why do you need the second check? When can select
+ delegate_->DidSelectAutocompleteSuggestion(names_[selected_line_]);
Ilya Sherman 2014/02/14 02:22:28 Rather than introducing a new method, it seems rea
+ else
+ delegate_->DidSelectSuggestion(identifiers_[selected_line_]);
+ } else {
delegate_->ClearPreviewedForm();
+ delegate_->ClearAutocompletePreviewedField();
Ilya Sherman 2014/02/14 02:22:28 Why can't ClearPreviewedForm() just handle clearin
+ }
}
void AutofillPopupControllerImpl::SelectNextLine() {
@@ -520,6 +527,7 @@ bool AutofillPopupControllerImpl::RemoveSelectedLine() {
if (HasSuggestions()) {
delegate_->ClearPreviewedForm();
+ delegate_->ClearAutocompletePreviewedField();
UpdateBoundsAndRedrawPopup();
} else {
Hide();

Powered by Google App Engine
This is Rietveld 408576698