| 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 <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #import "base/memory/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 | 13 |
| 14 // Code taken from <http://codereview.chromium.org/180036/diff/3001/3004>. | 14 // Code taken from <http://codereview.chromium.org/180036/diff/3001/3004>. |
| 15 // TODO(viettrungluu): Do we want common, standard code for drag hysteresis? | 15 // TODO(viettrungluu): Do we want common, standard code for drag hysteresis? |
| 16 const CGFloat kWebDragStartHysteresisX = 5.0; | 16 const CGFloat kWebDragStartHysteresisX = 5.0; |
| 17 const CGFloat kWebDragStartHysteresisY = 5.0; | 17 const CGFloat kWebDragStartHysteresisY = 5.0; |
| 18 const CGFloat kDragExpirationTimeout = 0.45; | 18 const CGFloat kDragExpirationTimeout = 0.45; |
| 19 | 19 |
| 20 } | 20 } |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 | 280 |
| 281 - (void)endDrag { | 281 - (void)endDrag { |
| 282 if ([button_ respondsToSelector:_cmd] && | 282 if ([button_ respondsToSelector:_cmd] && |
| 283 [button_ endDrag] != kDraggableButtonImplUseBase) { | 283 [button_ endDrag] != kDraggableButtonImplUseBase) { |
| 284 return; | 284 return; |
| 285 } | 285 } |
| 286 [button_ highlight:NO]; | 286 [button_ highlight:NO]; |
| 287 } | 287 } |
| 288 | 288 |
| 289 @end | 289 @end |
| OLD | NEW |