Chromium Code Reviews| Index: chrome/browser/ui/cocoa/browser_window_fullscreen_transition.h |
| diff --git a/chrome/browser/ui/cocoa/browser_window_enter_fullscreen_transition.h b/chrome/browser/ui/cocoa/browser_window_fullscreen_transition.h |
| similarity index 82% |
| rename from chrome/browser/ui/cocoa/browser_window_enter_fullscreen_transition.h |
| rename to chrome/browser/ui/cocoa/browser_window_fullscreen_transition.h |
| index d947200edfbad984fe189f5fbc940e898bcffdee..694a6409b6ae8acd7aff0de975bd1deca32bb274 100644 |
| --- a/chrome/browser/ui/cocoa/browser_window_enter_fullscreen_transition.h |
| +++ b/chrome/browser/ui/cocoa/browser_window_fullscreen_transition.h |
| @@ -8,7 +8,8 @@ |
| #import <Cocoa/Cocoa.h> |
| // This class is responsible for managing the custom transition of a |
| -// BrowserWindow from its normal state into an AppKit Fullscreen state. |
| +// BrowserWindow from its normal state into an AppKit Fullscreen state |
| +// and vice versa. |
| // |
| // By default, when AppKit Fullscreens a window, it creates a new virtual |
| // desktop and slides it in from the right of the screen. At the same time, the |
| @@ -28,7 +29,7 @@ |
| // drawRect: is called. As a result, the animation is effectively a no-op. When |
| // the animation is finished, the new web content flashes in. |
| // |
| -// The window's delegate can override two methods to customize the transition. |
| +// The window's delegate can override four methods to customize the transition. |
| // -customWindowsToEnterFullScreenForWindow: |
| // The return of this method is an array of NSWindows. Each window that is |
| // returned will be added to the new virtual desktop after the animation is |
| @@ -36,6 +37,12 @@ |
| // -window:startCustomAnimationToEnterFullScreenWithDuration: |
| // In this method, the window's delegate adds animations to the windows |
| // returned in the above method. |
| +// -customWindowsToExitFullScreenForWindow: |
| +// This method is similar to customWindowsToEnterFullScreenForWindow, |
| +// but is used for the animation is exiting full screen |
| +// -window:startCustomAnimationToExitFullScreenWithDuration: |
| +// In this method, the window's delegate adds animations to the windows |
| +// returned in the above method. |
| // |
| // The goal of this class is to mimic the default animation, but instead of |
| // taking a snapshot of the final web content, it uses the live web content |
| @@ -72,23 +79,22 @@ |
| // return [super constrainFrameRect:frame toScreen:screen]; |
| // } |
| -@interface BrowserWindowEnterFullscreenTransition : NSObject |
| + |
| +@interface BrowserWindowFullscreenTransition : NSObject |
| // Designated initializer. |window| is the NSWindow that is going to be moved |
| // into a fullscreen Space (virtual desktop), and resized to have the same size |
| // as the screen. |window|'s root view must be layer backed. |
| - (instancetype)initWithWindow:(NSWindow*)window; |
| -// Returns the windows to be used in the custom transition. |
| -// - Takes a snapshot of the current window. |
| -// - Makes a new snapshot window which shows the snapshot in the same |
| -// location as the current window. |
| -// - Adds the style mask NSFullScreenWindowMask to the current window. |
| -// - Makes the current window transparent, and resizes the current window to |
| -// be the same size as the screen. |
| -- (NSArray*)customWindowsToEnterFullScreen; |
| +// Returns the windows to be used in the custom exit transition. |
| +- (NSArray*)customWindowsToExitFullScreenTransition; |
| + |
| + |
| +// Returns the windows to be used in the custom enter transition. |
| +- (NSArray*)customWindowsToEnterFullScreenTransition; |
| -// Begins the animations used for the custom fullscreen transition. |
| +// Begins the animations used for the custom exit fullscreen transition. |
|
erikchen
2015/08/10 18:06:25
This comment doesn't apply to the exit fullscreen
spqchan1
2015/08/11 21:43:47
Done.
|
| // - Animates the snapshot to the full size of the screen while fading it out. |
| // - Animates the current window from it's original location to its final |
| // location, while fading it in. |
| @@ -96,15 +102,21 @@ |
| // There is no explicit logic to keep the two animations in sync. If this |
| // proves to be a problem, the relevant layers should attempt to sync up their |
| // time offsets with CACurrentMediaTime(). |
| -- (void)startCustomAnimationToEnterFullScreenWithDuration: |
| +- (void)startCustomExitFullScreenAnimationWithDuration: |
| (NSTimeInterval)duration; |
| +- (void)startCustomEnterFullScreenAnimationWithDuration: |
| + (NSTimeInterval)duration; |
| + |
| + |
| // When this method returns true, the NSWindow method |
| // -constrainFrameRect:toScreen: must return the frame rect without |
| // constraining it. The owner of the instance of this class is responsible for |
| // hooking up this logic. |
| - (BOOL)shouldWindowBeUnconstrained; |
| + |
|
erikchen
2015/08/10 18:06:25
whitespace
spqchan1
2015/08/11 21:43:47
Done.
|
| @end |
| + |
|
erikchen
2015/08/10 18:06:25
whitespace
spqchan1
2015/08/11 21:43:47
Done.
|
| #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_FULLSCREEN_TRANSITION_H_ |