OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/cocoa/fullscreen_controller.h" | 5 #import "chrome/browser/cocoa/fullscreen_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #import "chrome/browser/cocoa/browser_window_controller.h" | 9 #import "chrome/browser/cocoa/browser_window_controller.h" |
10 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" | 10 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 - (id)initWithFraction:(CGFloat)toFraction | 59 - (id)initWithFraction:(CGFloat)toFraction |
60 fullDuration:(CGFloat)fullDuration | 60 fullDuration:(CGFloat)fullDuration |
61 animationCurve:(NSInteger)animationCurve | 61 animationCurve:(NSInteger)animationCurve |
62 controller:(FullscreenController*)controller { | 62 controller:(FullscreenController*)controller { |
63 // Calculate the effective duration, based on the current shown fraction. | 63 // Calculate the effective duration, based on the current shown fraction. |
64 DCHECK(controller); | 64 DCHECK(controller); |
65 CGFloat fromFraction = [controller floatingBarShownFraction]; | 65 CGFloat fromFraction = [controller floatingBarShownFraction]; |
66 CGFloat effectiveDuration = fabs(fullDuration * (fromFraction - toFraction)); | 66 CGFloat effectiveDuration = fabs(fullDuration * (fromFraction - toFraction)); |
67 | 67 |
68 if ((self = [super gtm_initWithDuration:effectiveDuration | 68 if ((self = [super gtm_initWithDuration:effectiveDuration |
| 69 eventMask:NSLeftMouseDownMask |
69 animationCurve:animationCurve])) { | 70 animationCurve:animationCurve])) { |
70 startFraction_ = fromFraction; | 71 startFraction_ = fromFraction; |
71 endFraction_ = toFraction; | 72 endFraction_ = toFraction; |
72 controller_ = controller; | 73 controller_ = controller; |
73 } | 74 } |
74 return self; | 75 return self; |
75 } | 76 } |
76 | 77 |
77 // Called once per animation step. Overridden to change the floating bar's | 78 // Called once per animation step. Overridden to change the floating bar's |
78 // position based on the animation's progress. | 79 // position based on the animation's progress. |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 - (void)hideActiveWindowUI { | 591 - (void)hideActiveWindowUI { |
591 if (currentFullscreenMode_ != mac_util::kFullScreenModeNormal) { | 592 if (currentFullscreenMode_ != mac_util::kFullScreenModeNormal) { |
592 mac_util::ReleaseFullScreen(currentFullscreenMode_); | 593 mac_util::ReleaseFullScreen(currentFullscreenMode_); |
593 currentFullscreenMode_ = mac_util::kFullScreenModeNormal; | 594 currentFullscreenMode_ = mac_util::kFullScreenModeNormal; |
594 } | 595 } |
595 | 596 |
596 // TODO(rohitrao): Remove the Exit Fullscreen button. http://crbug.com/35956 | 597 // TODO(rohitrao): Remove the Exit Fullscreen button. http://crbug.com/35956 |
597 } | 598 } |
598 | 599 |
599 @end | 600 @end |
OLD | NEW |