Index: chrome/browser/ui/views/omnibox/omnibox_view_views.cc |
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc |
index 1be6241db0e5c3ec3d7193967f983635ecfca8d5..c878115e968e979f5e4edcce6b1f6a719a26b086 100644 |
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc |
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc |
@@ -776,12 +776,14 @@ void OmniboxViewViews::OnBlur() { |
views::Textfield::OnBlur(); |
model()->OnWillKillFocus(); |
- // If ZeroSuggest is active, we may have refused to show an update to the |
- // underlying permanent URL that happened while the popup was open, so |
- // revert to ensure that update is shown now. Otherwise, make sure to call |
- // CloseOmniboxPopup() unconditionally, so that if ZeroSuggest is in the midst |
- // of running but hasn't yet opened the popup, it will be halted. |
- if (!model()->user_input_in_progress() && model()->popup_model()->IsOpen()) |
+ // If ZeroSuggest is active, and there is evidence that there is a text |
+ // update to show, revert to ensure that update is shown now. Otherwise, |
+ // at least call CloseOmniboxPopup(), so that if ZeroSuggest is in the |
+ // midst of running but hasn't yet opened the popup, it will be halted. |
+ // If we fully reverted in this case, we'd lose the cursor/highlight |
+ // information saved above. |
+ if (!model()->user_input_in_progress() && model()->popup_model()->IsOpen() && |
+ text() != model()->PermanentText()) |
RevertAll(); |
else |
CloseOmniboxPopup(); |