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

Unified Diff: chrome/browser/cocoa/download_item_cell.mm

Issue 371060: Mac: Make download items less annoying by handling clicks more correctly. (Closed)
Patch Set: add comment, fix layout-o Created 11 years, 1 month 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/cocoa/download_item_cell.mm
diff --git a/chrome/browser/cocoa/download_item_cell.mm b/chrome/browser/cocoa/download_item_cell.mm
index 16b9edfaddffd96bac0c954cc546b92f6633ca87..a10856573d666c9702f945d91d8e22d994e32ab0 100644
--- a/chrome/browser/cocoa/download_item_cell.mm
+++ b/chrome/browser/cocoa/download_item_cell.mm
@@ -196,25 +196,28 @@ const int kCompleteAnimationDuration = 2.5;
}
// Use two distinct tracking rects for left and right parts.
+ // The tracking areas are also used to decide how to handle clicks. They must
+ // always be active, so the click is handled correctly when a download item
+ // is clicked while chrome is not the active app ( http://crbug.com/21916 ).
NSRect bounds = [[self controlView] bounds];
NSRect buttonRect, dropdownRect;
NSDivideRect(bounds, &dropdownRect, &buttonRect,
kDropdownAreaWidth, NSMaxXEdge);
- trackingAreaButton_.reset([[NSTrackingArea alloc]
- initWithRect:buttonRect
- options:(NSTrackingMouseEnteredAndExited |
- NSTrackingActiveInActiveApp)
- owner:self
- userInfo:nil]);
+ trackingAreaButton_.reset([[NSTrackingArea alloc]
+ initWithRect:buttonRect
+ options:(NSTrackingMouseEnteredAndExited |
+ NSTrackingActiveAlways)
+ owner:self
+ userInfo:nil]);
[[self controlView] addTrackingArea:trackingAreaButton_.get()];
- trackingAreaDropdown_.reset([[NSTrackingArea alloc]
- initWithRect:dropdownRect
- options:(NSTrackingMouseEnteredAndExited |
- NSTrackingActiveInActiveApp)
- owner:self
- userInfo:nil]);
+ trackingAreaDropdown_.reset([[NSTrackingArea alloc]
+ initWithRect:dropdownRect
+ options:(NSTrackingMouseEnteredAndExited |
+ NSTrackingActiveAlways)
+ owner:self
+ userInfo:nil]);
[[self controlView] addTrackingArea:trackingAreaDropdown_.get()];
}
« 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