| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "chrome/browser/ui/browser_commands_mac.h" | 5 #include "chrome/browser/ui/browser_commands_mac.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/mac/mac_util.h" | 8 #include "base/mac/mac_util.h" |
| 9 #include "chrome/browser/fullscreen.h" | 9 #include "chrome/browser/fullscreen.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| 11 #include "chrome/browser/ui/browser_commands.h" | 11 #include "chrome/browser/ui/browser_commands.h" |
| 12 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" | 12 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" |
| 13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
| 14 | 14 |
| 15 namespace chrome { | 15 namespace chrome { |
| 16 | 16 |
| 17 void ToggleFullscreenWithChromeOrFallback(Browser* browser) { | 17 void ToggleFullscreenWithChromeOrFallback(Browser* browser) { |
| 18 DCHECK(browser); | 18 DCHECK(browser); |
| 19 // In simplified fullscreen mode, the "WithChrome" variant does not exist. | 19 if (chrome::mac::SupportsSystemFullscreen()) |
| 20 // Call into the standard cross-platform fullscreen method instead. | |
| 21 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | |
| 22 if (command_line->HasSwitch(switches::kEnableSimplifiedFullscreen)) | |
| 23 ToggleFullscreenMode(browser); | |
| 24 else if (chrome::mac::SupportsSystemFullscreen()) | |
| 25 browser->fullscreen_controller()->ToggleBrowserFullscreenWithChrome(); | 20 browser->fullscreen_controller()->ToggleBrowserFullscreenWithChrome(); |
| 26 else | 21 else |
| 27 ToggleFullscreenMode(browser); | 22 ToggleFullscreenMode(browser); |
| 28 } | 23 } |
| 29 | 24 |
| 30 } // namespace chrome | 25 } // namespace chrome |
| OLD | NEW |