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

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

Issue 1876313002: Fixed a fullscreen race condition on OSX (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 8 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 BrowserWindowController;
11 11
12 // This class is responsible for managing the custom transition of a 12 // This class is responsible for managing the custom transition of a
13 // BrowserWindow from its normal state into an AppKit Fullscreen state 13 // BrowserWindow from its normal state into an AppKit Fullscreen state
14 // and vice versa. 14 // and vice versa.
15 // 15 //
16 // By default, when AppKit Fullscreens a window, it creates a new virtual 16 // 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 17 // 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, 18 // 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 19 // and the time is not customizable without elevated privileges or a
20 // self-modifying binary 20 // self-modifying binary
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // -windowDidExitFullScreen: 87 // -windowDidExitFullScreen:
88 // In addition, you should use initExitWithWindow:frame: instead of 88 // In addition, you should use initExitWithWindow:frame: instead of
89 // initEnterWithWindow:. For the frame parameter, you should pass the expected 89 // initEnterWithWindow:. For the frame parameter, you should pass the expected
90 // frame of the window at the end of the transition. If you want the window to 90 // frame of the window at the end of the transition. If you want the window to
91 // resize and move to the frame it had before entering fullscreen, you will be 91 // resize and move to the frame it had before entering fullscreen, you will be
92 // responsible for saving the value of the frame and passing it to the 92 // responsible for saving the value of the frame and passing it to the
93 // parameter. 93 // parameter.
94 94
95 @interface BrowserWindowFullscreenTransition : NSObject 95 @interface BrowserWindowFullscreenTransition : NSObject
96 96
97 // Designated initializers. |window| is the NSWindow that is going to be moved 97 // Designated initializers. |controller| is the BrowserWindowController of the
98 // into a fullscreen Space (virtual desktop), and resized to have the same size 98 // window that's going to be moved into a fullscreen Space.
99 // as the screen. |window|'s root view must be layer backed. 99 - (instancetype)initEnterWithController:(BrowserWindowController*)controller;
100 // initEnterWithWindow will create a BrowserWindowFullscreenTransition that 100 - (instancetype)initExitWithController:(BrowserWindowController*)controller;
101 // enters fullscreen. initExitWithWindow will create one that exits fullscreen,
102 // using |frame| as the frame that |window| is going to transition into.
103 - (instancetype)initEnterWithWindow:(FramedBrowserWindow*)window;
104 - (instancetype)initExitWithWindow:(FramedBrowserWindow*)window
105 frame:(NSRect)frame
106 tabStripBackgroundView:(NSView*)view;
107 101
108 // Returns the windows to be used in the custom fullscreen transition. 102 // Returns the windows to be used in the custom fullscreen transition.
109 - (NSArray*)customWindowsForFullScreenTransition; 103 - (NSArray*)customWindowsForFullScreenTransition;
110 104
105 // Returns true if the fullscreen transition is completed.
106 - (BOOL)isTransitionCompleted;
107
111 // This method begins animation for exit or enter fullscreen transition. 108 // This method begins animation for exit or enter fullscreen transition.
112 // In this method, the following happens: 109 // In this method, the following happens:
113 // - Animates the snapshot to the expected final size of the window while 110 // - Animates the snapshot to the expected final size of the window while
114 // fading it out. 111 // fading it out.
115 // - Animates the current window from its original to final location and size 112 // - Animates the current window from its original to final location and size
116 // while fading it in. 113 // while fading it in.
117 // If the transition is for exiting fullscreen, we would shrink the content view 114 // 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 115 // to the expected final size so that we can to avoid clipping from the
119 // window. 116 // window.
120 // Note: The two animations are added to different layers in different windows. 117 // 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. 129 // Returns the size of the window we expect the BrowserWindowLayout to have.
133 // During the exit fullscreen transition, the content size shrinks while the 130 // 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 131 // 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 132 // BrowserWindowLayout's window parameter to the content size instead of the
136 // actual window's size. 133 // actual window's size.
137 - (NSSize)desiredWindowLayoutSize; 134 - (NSSize)desiredWindowLayoutSize;
138 135
139 @end 136 @end
140 137
141 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_FULLSCREEN_TRANSITION_H_ 138 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_FULLSCREEN_TRANSITION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698