OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/views/frame/immersive_mode_controller.h" | 5 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" |
6 | 6 |
7 #include "chrome/browser/ui/views/frame/immersive_mode_controller_stub.h" | 7 #include "chrome/browser/ui/views/frame/immersive_mode_controller_stub.h" |
8 | 8 |
9 #if defined(OS_CHROMEOS) | 9 #if defined(OS_CHROMEOS) |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h" | 12 #include "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h" |
13 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
14 #endif // defined(OS_CHROMEOS) | 14 #endif // defined(OS_CHROMEOS) |
15 | 15 |
16 namespace chrome { | 16 namespace chrome { |
17 | 17 |
18 bool UseImmersiveFullscreen() { | 18 bool UseImmersiveFullscreen() { |
19 #if defined(OS_CHROMEOS) | 19 #if defined(OS_CHROMEOS) |
| 20 CommandLine* command = CommandLine::ForCurrentProcess(); |
20 // Kiosk mode needs the whole screen. | 21 // Kiosk mode needs the whole screen. |
21 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 22 if (command->HasSwitch(switches::kKioskMode)) |
22 return !command_line->HasSwitch(switches::kKioskMode) && | 23 return false; |
23 command_line->HasSwitch(ash::switches::kAshImmersiveFullscreen); | 24 // Immersive fullscreen is on by default. |
| 25 return !command->HasSwitch(ash::switches::kAshDisableImmersiveFullscreen); |
24 #endif | 26 #endif |
25 return false; | 27 return false; |
26 } | 28 } |
27 | 29 |
28 // Implemented here so all the code dealing with flags lives in one place. | 30 // Implemented here so all the code dealing with flags lives in one place. |
29 void EnableImmersiveFullscreenForTest() { | 31 void EnableImmersiveFullscreenForTest() { |
30 #if defined(OS_CHROMEOS) | 32 // Immersive fullscreen is on by default. If we turn it off, this function |
31 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 33 // will need to add kAshEnableImmersiveFullscreen to the command line. |
32 command_line->AppendSwitch(ash::switches::kAshImmersiveFullscreen); | |
33 #endif | |
34 } | 34 } |
35 | 35 |
36 ImmersiveModeController* CreateImmersiveModeController() { | 36 ImmersiveModeController* CreateImmersiveModeController() { |
37 #if defined(OS_CHROMEOS) | 37 #if defined(OS_CHROMEOS) |
38 return new ImmersiveModeControllerAsh(); | 38 return new ImmersiveModeControllerAsh(); |
39 #else | 39 #else |
40 return new ImmersiveModeControllerStub(); | 40 return new ImmersiveModeControllerStub(); |
41 #endif | 41 #endif |
42 } | 42 } |
43 | 43 |
44 } // namespace chrome | 44 } // namespace chrome |
OLD | NEW |