Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(499)

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_fullscreen_transition.h

Issue 1813693003: Fixed a fullscreen race condition on OSX (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_FULLSCREEN_TRANSITION_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_FULLSCREEN_TRANSITION_H_
6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_FULLSCREEN_TRANSITION_H_ 6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_FULLSCREEN_TRANSITION_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 @class FramedBrowserWindow; 10 @class FramedBrowserWindow;
11 11
12 @protocol BrowserWindowFullscreenTransitionDelegate
Robert Sesek 2016/03/18 16:41:13 Does this class always operate on a BrowserWindowC
13
14 // Called after the exit fullscreen animation is completed.
15 - (void)finishedExitingFullscreen;
16
17 @end
18
12 // This class is responsible for managing the custom transition of a 19 // This class is responsible for managing the custom transition of a
13 // BrowserWindow from its normal state into an AppKit Fullscreen state 20 // BrowserWindow from its normal state into an AppKit Fullscreen state
14 // and vice versa. 21 // and vice versa.
15 // 22 //
16 // By default, when AppKit Fullscreens a window, it creates a new virtual 23 // By default, when AppKit Fullscreens a window, it creates a new virtual
17 // desktop and slides it in from the right of the screen. At the same time, the 24 // desktop and slides it in from the right of the screen. At the same time, the
18 // old virtual desktop slides off to the left. This animation takes one second, 25 // old virtual desktop slides off to the left. This animation takes one second,
19 // and the time is not customizable without elevated privileges or a 26 // and the time is not customizable without elevated privileges or a
20 // self-modifying binary 27 // self-modifying binary
21 // (https://code.google.com/p/chromium/issues/detail?id=414527). During that 28 // (https://code.google.com/p/chromium/issues/detail?id=414527). During that
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 101
95 @interface BrowserWindowFullscreenTransition : NSObject 102 @interface BrowserWindowFullscreenTransition : NSObject
96 103
97 // Designated initializers. |window| is the NSWindow that is going to be moved 104 // Designated initializers. |window| is the NSWindow that is going to be moved
98 // into a fullscreen Space (virtual desktop), and resized to have the same size 105 // into a fullscreen Space (virtual desktop), and resized to have the same size
99 // as the screen. |window|'s root view must be layer backed. 106 // as the screen. |window|'s root view must be layer backed.
100 // initEnterWithWindow will create a BrowserWindowFullscreenTransition that 107 // initEnterWithWindow will create a BrowserWindowFullscreenTransition that
101 // enters fullscreen. initExitWithWindow will create one that exits fullscreen, 108 // enters fullscreen. initExitWithWindow will create one that exits fullscreen,
102 // using |frame| as the frame that |window| is going to transition into. 109 // using |frame| as the frame that |window| is going to transition into.
103 - (instancetype)initEnterWithWindow:(FramedBrowserWindow*)window; 110 - (instancetype)initEnterWithWindow:(FramedBrowserWindow*)window;
104 - (instancetype)initExitWithWindow:(FramedBrowserWindow*)window 111 - (instancetype)
105 frame:(NSRect)frame 112 initExitWithWindow:(FramedBrowserWindow*)window
106 tabStripBackgroundView:(NSView*)view; 113 delegate:(id<BrowserWindowFullscreenTransitionDelegate>)delegate
114 frame:(NSRect)frame
115 tabStripBackgroundView:(NSView*)view;
107 116
108 // Returns the windows to be used in the custom fullscreen transition. 117 // Returns the windows to be used in the custom fullscreen transition.
109 - (NSArray*)customWindowsForFullScreenTransition; 118 - (NSArray*)customWindowsForFullScreenTransition;
110 119
120 // Returns true if the fullscreen transition is completed.
121 - (BOOL)isTransitionCompleted;
122
111 // This method begins animation for exit or enter fullscreen transition. 123 // This method begins animation for exit or enter fullscreen transition.
112 // In this method, the following happens: 124 // In this method, the following happens:
113 // - Animates the snapshot to the expected final size of the window while 125 // - Animates the snapshot to the expected final size of the window while
114 // fading it out. 126 // fading it out.
115 // - Animates the current window from its original to final location and size 127 // - Animates the current window from its original to final location and size
116 // while fading it in. 128 // while fading it in.
117 // If the transition is for exiting fullscreen, we would shrink the content view 129 // If the transition is for exiting fullscreen, we would shrink the content view
118 // to the expected final size so that we can to avoid clipping from the 130 // to the expected final size so that we can to avoid clipping from the
119 // window. 131 // window.
120 // Note: The two animations are added to different layers in different windows. 132 // Note: The two animations are added to different layers in different windows.
(...skipping 11 matching lines...) Expand all
132 // Returns the size of the window we expect the BrowserWindowLayout to have. 144 // Returns the size of the window we expect the BrowserWindowLayout to have.
133 // During the exit fullscreen transition, the content size shrinks while the 145 // During the exit fullscreen transition, the content size shrinks while the
134 // window frame stays the same. When that happens, we want to set the 146 // window frame stays the same. When that happens, we want to set the
135 // BrowserWindowLayout's window parameter to the content size instead of the 147 // BrowserWindowLayout's window parameter to the content size instead of the
136 // actual window's size. 148 // actual window's size.
137 - (NSSize)desiredWindowLayoutSize; 149 - (NSSize)desiredWindowLayoutSize;
138 150
139 @end 151 @end
140 152
141 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_FULLSCREEN_TRANSITION_H_ 153 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_FULLSCREEN_TRANSITION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698