OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ui/message_center/cocoa/popup_controller.h" | 5 #import "ui/message_center/cocoa/popup_controller.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #import "base/mac/foundation_util.h" | 9 #import "base/mac/foundation_util.h" |
| 10 #import "base/mac/sdk_forward_declarations.h" |
10 #import "ui/base/cocoa/window_size_constants.h" | 11 #import "ui/base/cocoa/window_size_constants.h" |
11 #import "ui/message_center/cocoa/notification_controller.h" | 12 #import "ui/message_center/cocoa/notification_controller.h" |
12 #import "ui/message_center/cocoa/popup_collection.h" | 13 #import "ui/message_center/cocoa/popup_collection.h" |
13 #include "ui/message_center/message_center.h" | 14 #include "ui/message_center/message_center.h" |
14 | 15 |
15 #if !defined(MAC_OS_X_VERSION_10_7) || \ | 16 #if !defined(MAC_OS_X_VERSION_10_7) || \ |
16 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 | 17 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 |
17 enum { | 18 enum { |
18 NSWindowCollectionBehaviorFullScreenAuxiliary = 1 << 8 | 19 NSWindowCollectionBehaviorFullScreenAuxiliary = 1 << 8 |
19 }; | 20 }; |
20 | |
21 enum { | |
22 NSEventPhaseNone = 0, // event not associated with a phase. | |
23 NSEventPhaseBegan = 0x1 << 0, | |
24 NSEventPhaseStationary = 0x1 << 1, | |
25 NSEventPhaseChanged = 0x1 << 2, | |
26 NSEventPhaseEnded = 0x1 << 3, | |
27 NSEventPhaseCancelled = 0x1 << 4, | |
28 }; | |
29 typedef NSUInteger NSEventPhase; | |
30 | |
31 enum { | |
32 NSEventSwipeTrackingLockDirection = 0x1 << 0, | |
33 NSEventSwipeTrackingClampGestureAmount = 0x1 << 1 | |
34 }; | |
35 typedef NSUInteger NSEventSwipeTrackingOptions; | |
36 | |
37 @interface NSEvent (LionAPI) | |
38 - (NSEventPhase)phase; | |
39 - (CGFloat)scrollingDeltaX; | |
40 - (CGFloat)scrollingDeltaY; | |
41 - (void)trackSwipeEventWithOptions:(NSEventSwipeTrackingOptions)options | |
42 dampenAmountThresholdMin:(CGFloat)minDampenThreshold | |
43 max:(CGFloat)maxDampenThreshold | |
44 usingHandler:(void (^)(CGFloat gestureAmount, | |
45 NSEventPhase phase, | |
46 BOOL isComplete, | |
47 BOOL* stop))trackingHandler; | |
48 @end | |
49 #endif // MAC_OS_X_VERSION_10_7 | 21 #endif // MAC_OS_X_VERSION_10_7 |
50 | 22 |
51 //////////////////////////////////////////////////////////////////////////////// | 23 //////////////////////////////////////////////////////////////////////////////// |
52 | 24 |
53 @interface MCPopupController (Private) | 25 @interface MCPopupController (Private) |
54 - (void)notificationSwipeStarted; | 26 - (void)notificationSwipeStarted; |
55 - (void)notificationSwipeMoved:(CGFloat)amount; | 27 - (void)notificationSwipeMoved:(CGFloat)amount; |
56 - (void)notificationSwipeEnded:(BOOL)ended complete:(BOOL)isComplete; | 28 - (void)notificationSwipeEnded:(BOOL)ended complete:(BOOL)isComplete; |
57 @end | 29 @end |
58 | 30 |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 NSViewAnimationEndFrameKey: [NSValue valueWithRect:newBounds] | 219 NSViewAnimationEndFrameKey: [NSValue valueWithRect:newBounds] |
248 }; | 220 }; |
249 boundsAnimation_.reset([[NSViewAnimation alloc] | 221 boundsAnimation_.reset([[NSViewAnimation alloc] |
250 initWithViewAnimations:[NSArray arrayWithObject:animationDict]]); | 222 initWithViewAnimations:[NSArray arrayWithObject:animationDict]]); |
251 [boundsAnimation_ setDuration:[popupCollection_ popupAnimationDuration]]; | 223 [boundsAnimation_ setDuration:[popupCollection_ popupAnimationDuration]]; |
252 [boundsAnimation_ setDelegate:self]; | 224 [boundsAnimation_ setDelegate:self]; |
253 [boundsAnimation_ startAnimation]; | 225 [boundsAnimation_ startAnimation]; |
254 } | 226 } |
255 | 227 |
256 @end | 228 @end |
OLD | NEW |