| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/browser/ui/cocoa/draggable_button.h" | 5 #import "chrome/browser/ui/cocoa/draggable_button.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 @implementation DraggableButton | 9 @implementation DraggableButton |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 if ([draggableButtonImpl_ mouseUpImpl:theEvent] == | 32 if ([draggableButtonImpl_ mouseUpImpl:theEvent] == |
| 33 kDraggableButtonMixinCallSuper) { | 33 kDraggableButtonMixinCallSuper) { |
| 34 [super mouseUp:theEvent]; | 34 [super mouseUp:theEvent]; |
| 35 } | 35 } |
| 36 } | 36 } |
| 37 | 37 |
| 38 - (void)mouseDown:(NSEvent*)theEvent { | 38 - (void)mouseDown:(NSEvent*)theEvent { |
| 39 // The impl spins an event loop to distinguish clicks from drags, | 39 // The impl spins an event loop to distinguish clicks from drags, |
| 40 // which could result in our destruction. Wire ourselves down for | 40 // which could result in our destruction. Wire ourselves down for |
| 41 // the duration. | 41 // the duration. |
| 42 scoped_nsobject<DraggableButton> keepAlive([self retain]); | 42 base::scoped_nsobject<DraggableButton> keepAlive([self retain]); |
| 43 | 43 |
| 44 if ([draggableButtonImpl_ mouseDownImpl:theEvent] == | 44 if ([draggableButtonImpl_ mouseDownImpl:theEvent] == |
| 45 kDraggableButtonMixinCallSuper) { | 45 kDraggableButtonMixinCallSuper) { |
| 46 [super mouseDown:theEvent]; | 46 [super mouseDown:theEvent]; |
| 47 } | 47 } |
| 48 } | 48 } |
| 49 | 49 |
| 50 - (void)beginDrag:(NSEvent*)dragEvent { | 50 - (void)beginDrag:(NSEvent*)dragEvent { |
| 51 // Must be overridden by subclasses. | 51 // Must be overridden by subclasses. |
| 52 NOTREACHED(); | 52 NOTREACHED(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 @end // @interface DraggableButton | 55 @end // @interface DraggableButton |
| OLD | NEW |