Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_controller_private.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/mac/bind_objc_block.h" | 10 #include "base/mac/bind_objc_block.h" |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 508 style:style]; | 508 style:style]; |
| 509 } | 509 } |
| 510 | 510 |
| 511 - (void)enterImmersiveFullscreen { | 511 - (void)enterImmersiveFullscreen { |
| 512 RecordFullscreenWindowLocation([self window]); | 512 RecordFullscreenWindowLocation([self window]); |
| 513 RecordFullscreenStyle(IMMERSIVE_FULLSCREEN); | 513 RecordFullscreenStyle(IMMERSIVE_FULLSCREEN); |
| 514 | 514 |
| 515 // Set to NO by |-windowDidEnterFullScreen:|. | 515 // Set to NO by |-windowDidEnterFullScreen:|. |
| 516 enteringImmersiveFullscreen_ = YES; | 516 enteringImmersiveFullscreen_ = YES; |
| 517 | 517 |
| 518 // Create the fullscreen window. | |
|
erikchen
2015/10/01 20:32:45
Why did this get moved before the fade to black?
spqchan
2015/10/05 16:20:57
I'm want to reduce the amount of work that gets do
| |
| 519 fullscreenWindow_.reset([[self createFullscreenWindow] retain]); | |
| 520 savedRegularWindow_ = [[self window] retain]; | |
| 521 savedRegularWindowFrame_ = [savedRegularWindow_ frame]; | |
| 522 | |
| 518 // Fade to black. | 523 // Fade to black. |
| 519 const CGDisplayReservationInterval kFadeDurationSeconds = 0.6; | 524 const CGDisplayReservationInterval kFadeDurationSeconds = 0.6; |
| 520 Boolean didFadeOut = NO; | 525 Boolean didFadeOut = NO; |
| 521 CGDisplayFadeReservationToken token; | 526 CGDisplayFadeReservationToken token; |
| 522 if (CGAcquireDisplayFadeReservation(kFadeDurationSeconds, &token) | 527 if (CGAcquireDisplayFadeReservation(kFadeDurationSeconds, &token) |
| 523 == kCGErrorSuccess) { | 528 == kCGErrorSuccess) { |
| 524 didFadeOut = YES; | 529 didFadeOut = YES; |
| 525 CGDisplayFade(token, kFadeDurationSeconds / 2, kCGDisplayBlendNormal, | 530 CGDisplayFade(token, kFadeDurationSeconds / 2, kCGDisplayBlendNormal, |
| 526 kCGDisplayBlendSolidColor, 0.0, 0.0, 0.0, /*synchronous=*/true); | 531 kCGDisplayBlendSolidColor, 0.0, 0.0, 0.0, /*synchronous=*/true); |
| 527 } | 532 } |
| 528 | 533 |
| 529 // Create the fullscreen window. | 534 fullscreen_mac::SlidingStyle style = fullscreen_mac::OMNIBOX_TABS_NONE; |
| 530 fullscreenWindow_.reset([[self createFullscreenWindow] retain]); | 535 [self adjustUIForSlidingFullscreenStyle:style]; |
|
erikchen
2015/10/01 20:32:45
adjustUIForSlidingFullscreenStyle: calls layoutSub
spqchan
2015/10/05 16:20:58
I updated the description.
The problem is that yo
| |
| 531 savedRegularWindow_ = [[self window] retain]; | |
| 532 savedRegularWindowFrame_ = [savedRegularWindow_ frame]; | |
| 533 | 536 |
| 534 [self moveViewsForImmersiveFullscreen:YES | 537 [self moveViewsForImmersiveFullscreen:YES |
| 535 regularWindow:[self window] | 538 regularWindow:[self window] |
| 536 fullscreenWindow:fullscreenWindow_.get()]; | 539 fullscreenWindow:fullscreenWindow_.get()]; |
| 537 | 540 |
| 538 fullscreen_mac::SlidingStyle style = fullscreen_mac::OMNIBOX_TABS_NONE; | |
| 539 [self adjustUIForSlidingFullscreenStyle:style]; | |
| 540 | |
| 541 // AppKit is helpful and prevents NSWindows from having the same height as | 541 // AppKit is helpful and prevents NSWindows from having the same height as |
| 542 // the screen while the menu bar is showing. This only applies to windows on | 542 // the screen while the menu bar is showing. This only applies to windows on |
| 543 // a secondary screen, in a separate space. Calling [NSWindow | 543 // a secondary screen, in a separate space. Calling [NSWindow |
| 544 // setFrame:display:] with the screen's height will always reduce the | 544 // setFrame:display:] with the screen's height will always reduce the |
| 545 // height by the height of the MenuBar. Calling the method with any other | 545 // height by the height of the MenuBar. Calling the method with any other |
| 546 // height works fine. The relevant method in the 10.10 AppKit SDK is called: | 546 // height works fine. The relevant method in the 10.10 AppKit SDK is called: |
| 547 // _canAdjustSizeForScreensHaveSeparateSpacesIfFillingSecondaryScreen | 547 // _canAdjustSizeForScreensHaveSeparateSpacesIfFillingSecondaryScreen |
| 548 // | 548 // |
| 549 // TODO(erikchen): Refactor the logic to allow the window to be shown after | 549 // TODO(erikchen): Refactor the logic to allow the window to be shown after |
| 550 // the menubar has been hidden. This would remove the need for this hack. | 550 // the menubar has been hidden. This would remove the need for this hack. |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1157 return browser_->tab_strip_model()->GetActiveWebContents(); | 1157 return browser_->tab_strip_model()->GetActiveWebContents(); |
| 1158 } | 1158 } |
| 1159 | 1159 |
| 1160 - (PermissionBubbleManager*)permissionBubbleManager { | 1160 - (PermissionBubbleManager*)permissionBubbleManager { |
| 1161 if (WebContents* contents = [self webContents]) | 1161 if (WebContents* contents = [self webContents]) |
| 1162 return PermissionBubbleManager::FromWebContents(contents); | 1162 return PermissionBubbleManager::FromWebContents(contents); |
| 1163 return nil; | 1163 return nil; |
| 1164 } | 1164 } |
| 1165 | 1165 |
| 1166 @end // @implementation BrowserWindowController(Private) | 1166 @end // @implementation BrowserWindowController(Private) |
| OLD | NEW |