diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-10 16:29:45 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-10 16:29:45 +0000 |
commit | f12ab642b2bbe2107ef884beb7f8667b744a612e (patch) | |
tree | b9968f4247395065d6c93e91c06feeea6d2ca952 /chrome/browser/cocoa/browser_window_controller.mm | |
parent | 9458d27fa052b2495e10be1fcf3aba74793ac5c9 (diff) | |
download | chromium_src-f12ab642b2bbe2107ef884beb7f8667b744a612e.zip chromium_src-f12ab642b2bbe2107ef884beb7f8667b744a612e.tar.gz chromium_src-f12ab642b2bbe2107ef884beb7f8667b744a612e.tar.bz2 |
Mac: Gratuitous fullscreen animation.
BUG=19791
TEST=Hit cmd-shift-f. Drool.
Review URL: http://codereview.chromium.org/661045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41165 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/browser_window_controller.mm')
-rw-r--r-- | chrome/browser/cocoa/browser_window_controller.mm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm index 21f8da4..21b2a61 100644 --- a/chrome/browser/cocoa/browser_window_controller.mm +++ b/chrome/browser/cocoa/browser_window_controller.mm @@ -1617,6 +1617,17 @@ willAnimateFromState:(bookmarks::VisualState)oldState if (![self supportsFullscreen]) return; + // Fade to black. + const CGDisplayReservationInterval kFadeDurationSeconds = 0.6; + Boolean didFadeOut = NO; + CGDisplayFadeReservationToken token; + if (CGAcquireDisplayFadeReservation(kFadeDurationSeconds, &token) + == kCGErrorSuccess) { + didFadeOut = YES; + CGDisplayFade(token, kFadeDurationSeconds / 2, kCGDisplayBlendNormal, + kCGDisplayBlendSolidColor, 0.0, 0.0, 0.0, /*synchronous=*/true); + } + // Save the current first responder so we can restore after views are moved. NSWindow* window = [self window]; scoped_nsobject<FocusTracker> focusTracker( @@ -1716,6 +1727,13 @@ willAnimateFromState:(bookmarks::VisualState)oldState // We're done moving focus, so re-enable bar visibility changes. [self enableBarVisibilityUpdates]; + + // Fade back in. + if (didFadeOut) { + CGDisplayFade(token, kFadeDurationSeconds / 2, kCGDisplayBlendSolidColor, + kCGDisplayBlendNormal, 0.0, 0.0, 0.0, /*synchronous=*/false); + CGReleaseDisplayFadeReservation(token); + } } - (BOOL)isFullscreen { |