OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/browser_window_fullscreen_transition.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_fullscreen_transition.h" |
6 | 6 |
7 #include <QuartzCore/QuartzCore.h> | 7 #include <QuartzCore/QuartzCore.h> |
8 | 8 |
| 9 #include <memory> |
| 10 |
9 #include "base/mac/bind_objc_block.h" | 11 #include "base/mac/bind_objc_block.h" |
10 #include "base/mac/foundation_util.h" | 12 #include "base/mac/foundation_util.h" |
11 #include "base/mac/mac_util.h" | 13 #include "base/mac/mac_util.h" |
12 #import "base/mac/sdk_forward_declarations.h" | 14 #import "base/mac/sdk_forward_declarations.h" |
13 #include "base/macros.h" | 15 #include "base/macros.h" |
14 #include "base/memory/scoped_ptr.h" | |
15 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 16 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
16 #import "chrome/browser/ui/cocoa/framed_browser_window.h" | 17 #import "chrome/browser/ui/cocoa/framed_browser_window.h" |
17 #import "chrome/browser/ui/cocoa/tabs/tab_strip_background_view.h" | 18 #import "chrome/browser/ui/cocoa/tabs/tab_strip_background_view.h" |
18 | 19 |
19 namespace { | 20 namespace { |
20 | 21 |
21 NSString* const kPrimaryWindowAnimationID = @"PrimaryWindowAnimationID"; | 22 NSString* const kPrimaryWindowAnimationID = @"PrimaryWindowAnimationID"; |
22 NSString* const kSnapshotWindowAnimationID = @"SnapshotWindowAnimationID"; | 23 NSString* const kSnapshotWindowAnimationID = @"SnapshotWindowAnimationID"; |
23 NSString* const kAnimationIDKey = @"AnimationIDKey"; | 24 NSString* const kAnimationIDKey = @"AnimationIDKey"; |
24 | 25 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 130 |
130 // The frame that |primaryWindow_| is expected to have after the transition | 131 // The frame that |primaryWindow_| is expected to have after the transition |
131 // is finished. | 132 // is finished. |
132 NSRect finalFrame_; | 133 NSRect finalFrame_; |
133 | 134 |
134 // This view draws the tabstrip background during the exit animation. | 135 // This view draws the tabstrip background during the exit animation. |
135 base::scoped_nsobject<FullscreenTabStripBackgroundView> | 136 base::scoped_nsobject<FullscreenTabStripBackgroundView> |
136 fullscreenTabStripBackgroundView_; | 137 fullscreenTabStripBackgroundView_; |
137 | 138 |
138 // Locks and unlocks the FullSizeContentWindow. | 139 // Locks and unlocks the FullSizeContentWindow. |
139 scoped_ptr<FrameAndStyleLock> lock_; | 140 std::unique_ptr<FrameAndStyleLock> lock_; |
140 | 141 |
141 // Flag that indicates if the animation was completed. Sets to true at the | 142 // Flag that indicates if the animation was completed. Sets to true at the |
142 // end of the animation. | 143 // end of the animation. |
143 BOOL completedTransition_; | 144 BOOL completedTransition_; |
144 } | 145 } |
145 | 146 |
146 // Takes a snapshot of |primaryWindow_| and puts it in |snapshotLayer_|. | 147 // Takes a snapshot of |primaryWindow_| and puts it in |snapshotLayer_|. |
147 - (void)takeSnapshot; | 148 - (void)takeSnapshot; |
148 | 149 |
149 // Creates |snapshotWindow_| and adds |snapshotLayer_| to it. | 150 // Creates |snapshotWindow_| and adds |snapshotLayer_| to it. |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 return [[[window contentView] superview] layer]; | 544 return [[[window contentView] superview] layer]; |
544 } | 545 } |
545 | 546 |
546 - (NSPoint)pointRelativeToCurrentScreen:(NSPoint)point { | 547 - (NSPoint)pointRelativeToCurrentScreen:(NSPoint)point { |
547 NSRect screenFrame = [[primaryWindow_ screen] frame]; | 548 NSRect screenFrame = [[primaryWindow_ screen] frame]; |
548 return NSMakePoint(point.x - screenFrame.origin.x, | 549 return NSMakePoint(point.x - screenFrame.origin.x, |
549 point.y - screenFrame.origin.y); | 550 point.y - screenFrame.origin.y); |
550 } | 551 } |
551 | 552 |
552 @end | 553 @end |
OLD | NEW |