Chromium Code Reviews| 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" | |
| 11 #include "base/command_line.h" | |
| 12 #include "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h" | 10 #include "chrome/browser/ui/views/frame/immersive_mode_controller_ash.h" |
| 13 #include "chrome/common/chrome_switches.h" | |
| 14 #endif // defined(OS_CHROMEOS) | 11 #endif // defined(OS_CHROMEOS) |
| 15 | 12 |
| 16 namespace chrome { | 13 namespace chrome { |
| 17 | 14 |
| 18 bool UseImmersiveFullscreen() { | |
| 19 #if defined(OS_CHROMEOS) | |
| 20 CommandLine* command = CommandLine::ForCurrentProcess(); | |
| 21 // Kiosk mode needs the whole screen. | |
| 22 if (command->HasSwitch(switches::kKioskMode)) | |
| 23 return false; | |
| 24 // Immersive fullscreen is on by default. If you change the default you must | |
| 25 // change the enable function below and BrowserTest FullscreenBookmarkBar | |
| 26 // (which cannot depend on this function due to DEPS). | |
| 27 return !command->HasSwitch(ash::switches::kAshDisableImmersiveFullscreen); | |
| 28 #endif | |
| 29 return false; | |
| 30 } | |
| 31 | |
| 32 // Implemented here so all the code dealing with flags lives in one place. | 15 // Implemented here so all the code dealing with flags lives in one place. |
| 33 void EnableImmersiveFullscreenForTest() { | 16 void EnableImmersiveFullscreenForTest() { |
|
James Cook
2013/05/27 12:00:20
I would move this function to the ImmersiveFullscr
tfarina
2013/05/29 02:03:52
Done.
| |
| 34 // Immersive fullscreen is on by default. If we turn it off, this function | 17 // Immersive fullscreen is on by default. If we turn it off, this function |
| 35 // will need to add kAshEnableImmersiveFullscreen to the command line. | 18 // will need to add kAshEnableImmersiveFullscreen to the command line. |
| 36 } | 19 } |
| 37 | 20 |
| 38 ImmersiveModeController* CreateImmersiveModeController() { | 21 ImmersiveModeController* CreateImmersiveModeController() { |
| 39 #if defined(OS_CHROMEOS) | 22 #if defined(OS_CHROMEOS) |
| 40 return new ImmersiveModeControllerAsh(); | 23 return new ImmersiveModeControllerAsh(); |
| 41 #else | 24 #else |
| 42 return new ImmersiveModeControllerStub(); | 25 return new ImmersiveModeControllerStub(); |
| 43 #endif | 26 #endif |
| 44 } | 27 } |
| 45 | 28 |
| 46 } // namespace chrome | 29 } // namespace chrome |
| OLD | NEW |