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 "ash/accelerators/accelerator_commands.h" | 5 #include "ash/accelerators/accelerator_commands.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_delegate.h" | 8 #include "ash/shell_delegate.h" |
9 #include "ash/wm/window_cycle_controller.h" | 9 #include "ash/wm/window_cycle_controller.h" |
10 #include "ash/wm/window_state.h" | 10 #include "ash/wm/window_state.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 wm::WindowState* window_state = wm::GetActiveWindowState(); | 35 wm::WindowState* window_state = wm::GetActiveWindowState(); |
36 if (!window_state) | 36 if (!window_state) |
37 return; | 37 return; |
38 // Get out of fullscreen when in fullscreen mode. | 38 // Get out of fullscreen when in fullscreen mode. |
39 if (window_state->IsFullscreen()) | 39 if (window_state->IsFullscreen()) |
40 Shell::GetInstance()->delegate()->ToggleFullscreen(); | 40 Shell::GetInstance()->delegate()->ToggleFullscreen(); |
41 else | 41 else |
42 window_state->ToggleMaximized(); | 42 window_state->ToggleMaximized(); |
43 } | 43 } |
44 | 44 |
| 45 void ToggleFullscreen() { |
| 46 wm::WindowState* window_state = wm::GetActiveWindowState(); |
| 47 if (!window_state) |
| 48 return; |
| 49 |
| 50 if (window_state->maximize_when_fullscreen()) |
| 51 window_state->ToggleMaximized(); |
| 52 else |
| 53 Shell::GetInstance()->delegate()->ToggleFullscreen(); |
| 54 } |
| 55 |
45 } // namespace accelerators | 56 } // namespace accelerators |
46 } // namespace ash | 57 } // namespace ash |
OLD | NEW |