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

Unified Diff: chrome/browser/ui/cocoa/download/download_item_button.mm

Issue 10543033: Retain the controller in -[DownloadItemButton rightMouseDown:] before opening the menu that targets… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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/ui/cocoa/download/download_item_button.mm
diff --git a/chrome/browser/ui/cocoa/download/download_item_button.mm b/chrome/browser/ui/cocoa/download/download_item_button.mm
index d6f1c522a7a419d712deae344c38befb3c182bb7..de5c873e5e0b72380f294263e6ef1b46a9287c5c 100644
--- a/chrome/browser/ui/cocoa/download/download_item_button.mm
+++ b/chrome/browser/ui/cocoa/download/download_item_button.mm
@@ -43,6 +43,13 @@
}
}
+// Override to retain the controller, in case a closure is pumped that deletes
+// the DownloadItemController while the menu is open <http://crbug.com/129826>.
+- (void)rightMouseDown:(NSEvent*)event {
+ scoped_nsobject<DownloadItemController> ref([controller_ retain]);
+ [super rightMouseDown:event];
+}
+
- (void)menuDidClose:(NSMenu*)menu {
[[self cell] setHighlighted:NO];
}
« 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