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

Unified Diff: chrome/browser/ui/cocoa/draggable_button.mm

Issue 7715019: [Mac] Keep download buttons alive while processing events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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/ui/cocoa/draggable_button.mm
diff --git a/chrome/browser/ui/cocoa/draggable_button.mm b/chrome/browser/ui/cocoa/draggable_button.mm
index 91e8ef266f59d6ac9ac49819564edc756dea1816..1eb7d7dd7aa8c9e9773b98f4f7721976ce2589e7 100644
--- a/chrome/browser/ui/cocoa/draggable_button.mm
+++ b/chrome/browser/ui/cocoa/draggable_button.mm
@@ -36,6 +36,11 @@
}
- (void)mouseDown:(NSEvent*)theEvent {
+ // The impl spins an event loop to distinguish clicks from drags,
+ // which could result in our destruction. Wire ourselves down for
+ // the duration.
+ scoped_nsobject<DraggableButton> keepAlive([self retain]);
Robert Sesek 2011/08/23 22:56:48 Would it be better to do this in the impl?
Scott Hess - ex-Googler 2011/08/23 23:04:37 How?
Robert Sesek 2011/08/23 23:10:13 Retain button_ in the Impl in the loop?
+
if ([draggableButtonImpl_ mouseDownImpl:theEvent] ==
kDraggableButtonMixinCallSuper) {
[super mouseDown:theEvent];
« 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