Chromium Code Reviews| 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..6e1a704e8156aa1d375129bd30aeac880a35be3a 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 bool fullscreen_low_power_enabled_at_command_line = |
|
spqchan
2016/06/08 21:43:58
Why static? Do you mean const?
ccameron
2016/06/09 20:47:08
Oh -- I wanted to avoid re-looking-up at each call
|
| + 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( |