Index: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm |
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm |
index 05dd79f60aa29b9f2c517163933ed491ae3fa921..8c1457c4f6ddaa452cf7d430f62956f660778080 100644 |
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm |
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm |
@@ -817,6 +817,11 @@ bool OmniboxViewMac::OnDoCommandBySelector(SEL cmd) { |
(cmd == @selector(noop:) && |
([event type] == NSKeyDown || [event type] == NSKeyUp) && |
[event keyCode] == kVK_Return)) { |
+ // If the user hasn't entered any text in keyword search mode, we need to |
+ // return early in order to avoid cancelling the search. |
+ if (GetTextLength() == 0) |
+ return true; |
+ |
WindowOpenDisposition disposition = |
ui::WindowOpenDispositionFromNSEvent(event); |
model()->AcceptInput(disposition, false); |