summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/autocomplete_text_field.mm
diff options
context:
space:
mode:
authorsuzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-30 20:45:32 +0000
committersuzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-30 20:45:32 +0000
commit7cd363601dfdaad7d3c9a36f4a4085e5e039fa05 (patch)
tree9fd4c27c057573c6de4c359d74914e4b96426bb4 /chrome/browser/cocoa/autocomplete_text_field.mm
parented0047bec1d0de1f668daf6a35af62f4d377b399 (diff)
downloadchromium_src-7cd363601dfdaad7d3c9a36f4a4085e5e039fa05.zip
chromium_src-7cd363601dfdaad7d3c9a36f4a4085e5e039fa05.tar.gz
chromium_src-7cd363601dfdaad7d3c9a36f4a4085e5e039fa05.tar.bz2
[Mac]Fix issue 34343: "Tab to search" hint on omnibox disappears on drag dropped tab.
This CL is just a clone of http://codereview.chromium.org/1519005. As I just rebuilt my working environment. BUG=34343 TEST=Input www.google.com to trigger "tab to search" hint, then drag the tab into a new window, then check if "tab to search" hint is still there. Review URL: http://codereview.chromium.org/1523016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46112 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/autocomplete_text_field.mm')
-rw-r--r--chrome/browser/cocoa/autocomplete_text_field.mm11
1 files changed, 11 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/autocomplete_text_field.mm b/chrome/browser/cocoa/autocomplete_text_field.mm
index a4242bb..f24cfa5 100644
--- a/chrome/browser/cocoa/autocomplete_text_field.mm
+++ b/chrome/browser/cocoa/autocomplete_text_field.mm
@@ -320,6 +320,17 @@
if (doAccept) {
[[BrowserWindowController browserWindowControllerForView:self]
lockBarVisibilityForOwner:self withAnimation:YES delay:NO];
+
+ // Tells the observer that we get the focus.
+ // But we can't call observer_->OnKillFocus() in resignFirstResponder:,
+ // because the first responder will be immediately set to the field editor
+ // when calling [super becomeFirstResponder], thus we won't receive
+ // resignFirstResponder: anymore when losing focus.
+ if (observer_) {
+ NSEvent* theEvent = [NSApp currentEvent];
+ const bool controlDown = ([theEvent modifierFlags]&NSControlKeyMask) != 0;
+ observer_->OnSetFocus(controlDown);
+ }
}
return doAccept;
}