Chromium Code Reviews| 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 "chrome/browser/fullscreen.h" | 8 #include "chrome/browser/fullscreen.h" |
| 9 #include "chrome/browser/profiles/profile.h" | |
| 9 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_commands.h" | 11 #include "chrome/browser/ui/browser_commands.h" |
| 11 #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h" | 12 #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h" |
| 12 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" | 13 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" |
| 13 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
| 15 #include "chrome/common/pref_names.h" | |
| 16 #include "components/prefs/pref_service.h" | |
| 14 | 17 |
| 15 namespace chrome { | 18 namespace chrome { |
| 16 | 19 |
| 17 void ToggleFullscreenWithToolbarOrFallback(Browser* browser) { | 20 void ToggleFullscreenWithToolbarOrFallback(Browser* browser) { |
| 18 DCHECK(browser); | 21 DCHECK(browser); |
| 19 if (chrome::mac::SupportsSystemFullscreen()) | 22 if (chrome::mac::SupportsSystemFullscreen()) |
| 20 browser->exclusive_access_manager() | 23 browser->exclusive_access_manager() |
| 21 ->fullscreen_controller() | 24 ->fullscreen_controller() |
| 22 ->ToggleBrowserFullscreenWithToolbar(); | 25 ->ToggleBrowserFullscreenWithToolbar(); |
| 23 else | 26 else |
| 24 ToggleFullscreenMode(browser); | 27 ToggleFullscreenMode(browser); |
| 25 } | 28 } |
| 26 | 29 |
| 27 void ToggleFullscreenToolbar(Browser* browser) { | 30 void ToggleFullscreenToolbar(Browser* browser) { |
| 28 DCHECK(browser); | 31 DCHECK(browser); |
| 29 browser->exclusive_access_manager()->context()->ToggleFullscreenToolbar(); | 32 PrefService* prefs = browser->profile()->GetPrefs(); |
| 33 bool showToolbar = !prefs->GetBoolean(prefs::kShowFullscreenToolbar); | |
|
Robert Sesek
2016/02/26 20:42:27
naming: show_toolbar
spqchan
2016/02/26 23:24:59
Done.
| |
| 34 prefs->SetBoolean(prefs::kShowFullscreenToolbar, showToolbar); | |
| 30 } | 35 } |
| 31 | 36 |
| 32 } // namespace chrome | 37 } // namespace chrome |
| OLD | NEW |