summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-31 21:21:31 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-31 21:21:31 +0000
commitccc9b402d3dc820737ae1a50dd4ef6d381af5591 (patch)
treecfbff267ce68e9b358e91388bb9c96ce79148875
parent2b0a53c333584133e5fb67996fcc70c0c9041a5f (diff)
downloadchromium_src-ccc9b402d3dc820737ae1a50dd4ef6d381af5591.zip
chromium_src-ccc9b402d3dc820737ae1a50dd4ef6d381af5591.tar.gz
chromium_src-ccc9b402d3dc820737ae1a50dd4ef6d381af5591.tar.bz2
[Mac] Fix operation of Control key in Omnibox.
http://crbug.com/20455 TEST=Enter "this" into address bar. Hold Control, should see "www.this.com" as first item. Release, and it should go back to "this" immediately. Review URL: http://codereview.chromium.org/182021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24939 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_mac.mm8
1 files changed, 3 insertions, 5 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
index d632046..ca63253 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
@@ -570,10 +570,8 @@ void AutocompleteEditViewMac::OnWillBeginEditing() {
// We should only arrive here when the field is focussed.
DCHECK([field_ currentEditor]);
- // TODO(shess): Detect control-key situation. Since this code is
- // called on first edit, not on receipt of focus, it may be that we
- // cannot correctly handle this without refactoring.
- const bool controlDown = false;
+ NSEvent* theEvent = [NSApp currentEvent];
+ const bool controlDown = ([theEvent modifierFlags]&NSControlKeyMask) != 0;
model_->OnSetFocus(controlDown);
// Capture the current state.
@@ -861,7 +859,7 @@ std::wstring AutocompleteEditViewMac::GetClipboardText(Clipboard* clipboard) {
// the popup to reflect this. See autocomplete_edit.cc
// OnControlKeyChanged() and OnAfterPossibleChange().
- (void)control:(NSControl*)control flagsChanged:(NSEvent*)theEvent {
- BOOL controlFlag = ([theEvent modifierFlags]&NSControlKeyMask) != 0;
+ bool controlFlag = ([theEvent modifierFlags]&NSControlKeyMask) != 0;
edit_view_->OnControlKeyChanged(controlFlag);
}