Index: chrome/browser/autocomplete/autocomplete_edit_view_mac.mm |
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm |
index f49963a13ffcd07ff2b36966419f9139bfc66114..5a53473b1ad8678208fd50b8e0cab7e4964c2e22 100644 |
--- a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm |
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm |
@@ -573,10 +573,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. |
@@ -847,7 +845,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); |
} |