Index: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm |
diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm |
index 6c25cc82855b4c1f9dfe9e570a413e9aaf04c648..08884d2f44817dea742adfea54bf9f9002660ec7 100644 |
--- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm |
+++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm |
@@ -397,6 +397,16 @@ const CGFloat kAnimationDuration = 0.2; |
// (Overridden from NSResponder) |
- (BOOL)becomeFirstResponder { |
+ // If the event is a left-mouse click, and it lands on a decoration, then the |
+ // event should not cause the text field to become first responder. |
+ NSEvent* event = [NSApp currentEvent]; |
+ if ([event type] == NSLeftMouseDown) { |
+ LocationBarDecoration* decoration = |
+ [[self cell] decorationForEvent:event inRect:[self bounds] ofView:self]; |
+ if (decoration) |
+ return NO; |
+ } |
+ |
BOOL doAccept = [super becomeFirstResponder]; |
if (doAccept) { |
[[BrowserWindowController browserWindowControllerForView:self] |