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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_view_views.cc

Issue 1060613004: Fix a variety of omnibox bugs around zerosuggest, the escape key, or both. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Safer escape handling method Created 5 years, 8 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/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 3bcdeba9133953114688235afb2c112c84aa6511..2d7a8a06a551701e5d9b5efdcab656888a0115ea 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -817,6 +817,8 @@ bool OmniboxViewViews::SkipDefaultKeyEventProcessing(
model()->popup_model()->IsOpen())) {
return true;
}
+ if (event.key_code() == ui::VKEY_ESCAPE)
+ return model()->WillHandleEscapeKey();
return Textfield::SkipDefaultKeyEventProcessing(event);
}
@@ -859,7 +861,16 @@ void OmniboxViewViews::OnBlur() {
views::Textfield::OnBlur();
model()->OnWillKillFocus();
- CloseOmniboxPopup();
+
+ // 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())
+ RevertAll();
+ else
+ CloseOmniboxPopup();
// Tell the model to reset itself.
model()->OnKillFocus();

Powered by Google App Engine
This is Rietveld 408576698