diff options
-rw-r--r-- | chrome/browser/cocoa/autocomplete_text_field.mm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/autocomplete_text_field.mm b/chrome/browser/cocoa/autocomplete_text_field.mm index 5d598a6..d20651b9 100644 --- a/chrome/browser/cocoa/autocomplete_text_field.mm +++ b/chrome/browser/cocoa/autocomplete_text_field.mm @@ -119,8 +119,16 @@ // let the icon handle the click. const BOOL ctrlKey = ([theEvent modifierFlags] & NSControlKeyMask) != 0; for (AutocompleteTextFieldIcon* icon in [cell layedOutIcons:bounds]) { - if (NSMouseInRect(location, [icon rect], flipped) && !ctrlKey) { - [icon view]->OnMousePressed([icon rect]); + if (NSMouseInRect(location, [icon rect], flipped)) { + if (ctrlKey) { + // If the click was a Ctrl+Click, then imitate a right click and open + // the contextual menu. + NSText* editor = [self currentEditor]; + NSMenu* menu = [editor menuForEvent:theEvent]; + [NSMenu popUpContextMenu:menu withEvent:theEvent forView:editor]; + } else { + [icon view]->OnMousePressed([icon rect]); + } return; } } |