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/common/accelerators/accelerator_commands.h" | 5 #include "ash/common/accelerators/accelerator_commands.h" |
6 | 6 |
7 #include "ash/accelerators/accelerator_commands_aura.h" | 7 #include "ash/accelerators/accelerator_commands_aura.h" |
8 #include "ash/aura/wm_window_aura.h" | 8 #include "ash/aura/wm_window_aura.h" |
9 #include "ash/common/ash_switches.h" | 9 #include "ash/common/ash_switches.h" |
10 #include "ash/common/wm/window_state.h" | 10 #include "ash/common/wm/window_state.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 DISALLOW_COPY_AND_ASSIGN(MaximizableWidgetDelegate); | 45 DISALLOW_COPY_AND_ASSIGN(MaximizableWidgetDelegate); |
46 }; | 46 }; |
47 | 47 |
48 // Returns true if |window_state|'s window is in immersive fullscreen. Infer | 48 // Returns true if |window_state|'s window is in immersive fullscreen. Infer |
49 // whether the window is in immersive fullscreen based on whether the shelf is | 49 // whether the window is in immersive fullscreen based on whether the shelf is |
50 // hidden when the window is fullscreen. (This is not quite right because the | 50 // hidden when the window is fullscreen. (This is not quite right because the |
51 // shelf is hidden if a window is in both immersive fullscreen and tab | 51 // shelf is hidden if a window is in both immersive fullscreen and tab |
52 // fullscreen.) | 52 // fullscreen.) |
53 bool IsInImmersiveFullscreen(ash::wm::WindowState* window_state) { | 53 bool IsInImmersiveFullscreen(ash::wm::WindowState* window_state) { |
54 return window_state->IsFullscreen() && | 54 return window_state->IsFullscreen() && |
55 (window_state->shelf_mode_in_fullscreen() != | 55 !window_state->hide_shelf_when_fullscreen(); |
56 ash::wm::WindowState::SHELF_HIDDEN); | |
57 } | 56 } |
58 | 57 |
59 } // namespace | 58 } // namespace |
60 | 59 |
61 typedef InProcessBrowserTest AcceleratorCommandsBrowserTest; | 60 typedef InProcessBrowserTest AcceleratorCommandsBrowserTest; |
62 | 61 |
63 // Confirm that toggling window miximized works properly | 62 // Confirm that toggling window miximized works properly |
64 IN_PROC_BROWSER_TEST_F(AcceleratorCommandsBrowserTest, ToggleMaximized) { | 63 IN_PROC_BROWSER_TEST_F(AcceleratorCommandsBrowserTest, ToggleMaximized) { |
65 ASSERT_TRUE(ash::Shell::HasInstance()) << "No Instance"; | 64 ASSERT_TRUE(ash::Shell::HasInstance()) << "No Instance"; |
66 ash::wm::WindowState* window_state = ash::wm::GetActiveWindowState(); | 65 ash::wm::WindowState* window_state = ash::wm::GetActiveWindowState(); |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 CloseAppWindow(app_window); | 307 CloseAppWindow(app_window); |
309 } | 308 } |
310 } | 309 } |
311 | 310 |
312 INSTANTIATE_TEST_CASE_P(InitiallyRestored, | 311 INSTANTIATE_TEST_CASE_P(InitiallyRestored, |
313 AcceleratorCommandsPlatformAppFullscreenBrowserTest, | 312 AcceleratorCommandsPlatformAppFullscreenBrowserTest, |
314 Values(ui::SHOW_STATE_NORMAL)); | 313 Values(ui::SHOW_STATE_NORMAL)); |
315 INSTANTIATE_TEST_CASE_P(InitiallyMaximized, | 314 INSTANTIATE_TEST_CASE_P(InitiallyMaximized, |
316 AcceleratorCommandsPlatformAppFullscreenBrowserTest, | 315 AcceleratorCommandsPlatformAppFullscreenBrowserTest, |
317 Values(ui::SHOW_STATE_MAXIMIZED)); | 316 Values(ui::SHOW_STATE_MAXIMIZED)); |
OLD | NEW |