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

Unified Diff: chrome/browser/ui/cocoa/browser_window_controller_private.mm

Issue 1990163003: Mac fullscreen low power: Add layout interactions and flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add nil check for tests Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/browser_window_controller_private.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_private.mm b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
index a74f0d7764abc4f6423c9b2c9fc25970127d14df..8ff1fd69f5608825aacad664ac207ad7ba366232 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller_private.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
@@ -31,6 +31,7 @@
#import "chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.h"
#import "chrome/browser/ui/cocoa/floating_bar_backing_view.h"
#import "chrome/browser/ui/cocoa/framed_browser_window.h"
+#include "chrome/browser/ui/cocoa/fullscreen_low_power_coordinator.h"
#import "chrome/browser/ui/cocoa/fullscreen_window.h"
#import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h"
#include "chrome/browser/ui/cocoa/last_active_browser_cocoa.h"
@@ -793,6 +794,9 @@ - (void)windowDidExitFullScreen:(NSNotification*)notification {
return;
}
+ // Destroy the NSWindow used for fullscreen low power mode.
+ fullscreenLowPowerCoordinator_.reset();
+
if (notification) // For System Fullscreen when non-nil.
[self deregisterForContentViewResizeNotifications];
@@ -817,6 +821,7 @@ - (void)windowDidFailToEnterFullScreen:(NSWindow*)window {
[self deregisterForContentViewResizeNotifications];
[self resetCustomAppKitFullscreenVariables];
[self adjustUIForExitingFullscreenAndStopOmniboxSliding];
+ fullscreenLowPowerCoordinator_.reset();
}
- (void)windowDidFailToExitFullScreen:(NSWindow*)window {
@@ -1031,6 +1036,12 @@ - (void)applyLayout:(BrowserWindowLayout*)layout {
maxWidth:NSWidth(output.contentAreaFrame)];
exclusiveAccessController_->Layout(output.fullscreenExitButtonMaxY);
+
+ if (fullscreenLowPowerCoordinator_) {
+ fullscreenLowPowerCoordinator_->SetLayoutParameters(
+ output.toolbarFrame, output.infoBarFrame, output.contentAreaFrame,
+ output.downloadShelfFrame);
+ }
}
- (void)updateSubviewZOrder {
@@ -1184,11 +1195,26 @@ - (NSArray*)customWindowsToEnterFullScreenForWindow:(NSWindow*)window {
if (![self shouldUseCustomAppKitFullscreenTransition:YES])
return nil;
+ WebContents* webContents = [self webContents];
+ NSWindow* lowPowerWindow = nil;
+ if (webContents) {
+ fullscreenLowPowerCoordinator_.reset(new FullscreenLowPowerCoordinatorCocoa(
+ [self window],
+ webContents->GetRenderWidgetHostView()->GetAcceleratedWidgetMac()));
+ lowPowerWindow =
+ fullscreenLowPowerCoordinator_->GetFullscreenLowPowerWindow();
+ }
+
fullscreenTransition_.reset(
[[BrowserWindowFullscreenTransition alloc] initEnterWithController:self]);
NSArray* customWindows =
[fullscreenTransition_ customWindowsForFullScreenTransition];
+ if (customWindows && lowPowerWindow)
+ customWindows = [customWindows arrayByAddingObject:lowPowerWindow];
+ else
+ fullscreenLowPowerCoordinator_.reset();
+
isUsingCustomAnimation_ = customWindows != nil;
return customWindows;
}
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.mm ('k') | chrome/browser/ui/cocoa/fullscreen_low_power_coordinator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698