Status: Untriaged
Owner: [email protected]
CC: [email protected],  [email protected]
Labels: Type-Bug Pri-2 OS-All Area-Misc Size-Medium

New issue 21362 by [email protected]: The original text and selection  
can't be reverted correctly when pressing escape key in omnibox if  
currently selected line is not the default match.
http://code.google.com/p/chromium/issues/detail?id=21362

What steps will reproduce the problem?
1. input something in omnibox and make sure inline autocomplete is
triggered.
2. press down key to select another line in popup view.
3. press escape key to revert the selection.

What is the expected output?
The text and selection in omnibox shall be reverted, including the inline
autocomplete text.

What do you see instead?
Only user input text was reverted, the inline autocomplete text was
missing.

Please use labels and text to provide additional information.

I'm not sure what is the intended behavior here, but both Linux and Mac
version revert the input autocomplete text.

Looking into the code, you may find that Linux and Mac's implementation
AutocompleteEditView::of OnTemporaryTextMaybeChanged() method backup both
text and selection and revert them in OnRevertTemporaryText() method. But
windows implementation only backups and restores selection, which has no
effect because when reverting the selection in OnRevertTemporaryText(), the
text is not reverted properly and does not contain the originally selected
portion.

The simplest solution would be modifying autocomplete_edit_view_win.cc to
backup and restore both text and selection. But according to the comment  
of  OnTemporaryTextMaybeChanged() and OnRevertTemporaryText(), seems that  
these
two methods shall only backup and restore selection, and the text shall be
reverted properly before calling OnRevertTemporaryText().

So seems that the more proper solution would be fixing
AutocompletePopupModel::SetSelectedLine() to revert the text properly when
reset_to_default is true. I'm preparing a CL following this approach, will
send it out asap for your review.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/group/chromium-bugs
-~----------~----~----~----~------~----~------~--~---

Reply via email to