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

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

Issue 2047103003: Mac fullscreen low power: Add unittests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IRF Created 4 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/fullscreen_low_power_coordinator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b6ce3acc059d881b2597ef04cee0481b18c728ad..1c9c69e72106d753329d9b5b305f05c81ced564f 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller_private.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
@@ -1195,14 +1195,20 @@ - (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();
+ static const bool fullscreen_low_power_enabled_at_command_line =
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableFullscreenLowPowerMode);
+ if (fullscreen_low_power_enabled_at_command_line) {
+ WebContents* webContents = [self webContents];
+ if (webContents && webContents->GetRenderWidgetHostView()) {
+ fullscreenLowPowerCoordinator_.reset(
+ new FullscreenLowPowerCoordinatorCocoa(
+ [self window], webContents->GetRenderWidgetHostView()
+ ->GetAcceleratedWidgetMac()));
+ lowPowerWindow =
+ fullscreenLowPowerCoordinator_->GetFullscreenLowPowerWindow();
+ }
}
fullscreenTransition_.reset(
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/fullscreen_low_power_coordinator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698