Index: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm |
diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm |
index 30d2f598da30cabc50ebed3f3f82695b6a4122c6..817cabcd185d68c59f28e106ffd1d988f13ae828 100644 |
--- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm |
+++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm |
@@ -398,12 +398,14 @@ BOOL ThePasteboardIsTooDamnBig() { |
} |
// If the escape key was pressed and no revert happened and we're in |
- // fullscreen mode, make it resign key. |
+ // fullscreen mode, give focus to the web contents, which may dismiss the |
+ // overlay. |
if (cmd == @selector(cancelOperation:)) { |
BrowserWindowController* windowController = |
[BrowserWindowController browserWindowControllerForView:self]; |
- if ([windowController inPresentationMode]) { |
+ if ([windowController isFullscreen]) { |
[windowController focusTabContents]; |
+ textChangedByKeyEvents_ = NO; |
return; |
} |
} |