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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_controller_private.mm

Issue 2059863004: Mac video: Enable fullscreen low power mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #import "base/auto_reset.h" 9 #import "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 isUsingCustomAnimation_ = NO; 1189 isUsingCustomAnimation_ = NO;
1190 } 1190 }
1191 1191
1192 - (NSArray*)customWindowsToEnterFullScreenForWindow:(NSWindow*)window { 1192 - (NSArray*)customWindowsToEnterFullScreenForWindow:(NSWindow*)window {
1193 DCHECK([window isEqual:self.window]); 1193 DCHECK([window isEqual:self.window]);
1194 1194
1195 if (![self shouldUseCustomAppKitFullscreenTransition:YES]) 1195 if (![self shouldUseCustomAppKitFullscreenTransition:YES])
1196 return nil; 1196 return nil;
1197 1197
1198 NSWindow* lowPowerWindow = nil; 1198 NSWindow* lowPowerWindow = nil;
1199 static const bool fullscreen_low_power_enabled_at_command_line = 1199 static const bool fullscreen_low_power_disabled_at_command_line =
1200 base::CommandLine::ForCurrentProcess()->HasSwitch( 1200 base::CommandLine::ForCurrentProcess()->HasSwitch(
1201 switches::kEnableFullscreenLowPowerMode); 1201 switches::kDisableFullscreenLowPowerMode);
1202 if (fullscreen_low_power_enabled_at_command_line) { 1202 if (!fullscreen_low_power_disabled_at_command_line) {
1203 WebContents* webContents = [self webContents]; 1203 WebContents* webContents = [self webContents];
1204 if (webContents && webContents->GetRenderWidgetHostView()) { 1204 if (webContents && webContents->GetRenderWidgetHostView()) {
1205 fullscreenLowPowerCoordinator_.reset( 1205 fullscreenLowPowerCoordinator_.reset(
1206 new FullscreenLowPowerCoordinatorCocoa( 1206 new FullscreenLowPowerCoordinatorCocoa(
1207 [self window], webContents->GetRenderWidgetHostView() 1207 [self window], webContents->GetRenderWidgetHostView()
1208 ->GetAcceleratedWidgetMac())); 1208 ->GetAcceleratedWidgetMac()));
1209 lowPowerWindow = 1209 lowPowerWindow =
1210 fullscreenLowPowerCoordinator_->GetFullscreenLowPowerWindow(); 1210 fullscreenLowPowerCoordinator_->GetFullscreenLowPowerWindow();
1211 } 1211 }
1212 } 1212 }
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 if (fullscreenLowPowerCoordinator_) 1289 if (fullscreenLowPowerCoordinator_)
1290 fullscreenLowPowerCoordinator_->SetHasActiveSheet(false); 1290 fullscreenLowPowerCoordinator_->SetHasActiveSheet(false);
1291 } 1291 }
1292 1292
1293 - (void)childWindowsDidChange { 1293 - (void)childWindowsDidChange {
1294 if (fullscreenLowPowerCoordinator_) 1294 if (fullscreenLowPowerCoordinator_)
1295 fullscreenLowPowerCoordinator_->ChildWindowsChanged(); 1295 fullscreenLowPowerCoordinator_->ChildWindowsChanged();
1296 } 1296 }
1297 1297
1298 @end // @implementation BrowserWindowController(Private) 1298 @end // @implementation BrowserWindowController(Private)
OLDNEW
« no previous file with comments | « no previous file | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698