Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(816)

Unified Diff: chrome/browser/autocomplete/autocomplete_edit_view_mac.mm

Issue 182021: [Mac] Fix operation of Control key in Omnibox. (Closed)
Patch Set: Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698