OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ash/chrome_shell_delegate.h" | 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
6 | 6 |
7 #include "apps/shell_window.h" | 7 #include "apps/shell_window.h" |
8 #include "apps/ui/native_app_window.h" | 8 #include "apps/ui/native_app_window.h" |
9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
11 #include "ash/shell_delegate.h" | 11 #include "ash/shell_delegate.h" |
12 #include "ash/wm/window_properties.h" | |
13 #include "ash/wm/window_state.h" | 12 #include "ash/wm/window_state.h" |
14 #include "base/command_line.h" | 13 #include "base/command_line.h" |
15 #include "chrome/browser/apps/app_browsertest_util.h" | 14 #include "chrome/browser/apps/app_browsertest_util.h" |
16 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
17 #include "chrome/browser/ui/browser_commands.h" | 16 #include "chrome/browser/ui/browser_commands.h" |
18 #include "chrome/browser/ui/browser_finder.h" | 17 #include "chrome/browser/ui/browser_finder.h" |
19 #include "chrome/browser/ui/browser_window.h" | 18 #include "chrome/browser/ui/browser_window.h" |
20 #include "chrome/browser/ui/immersive_fullscreen_configuration.h" | 19 #include "chrome/browser/ui/immersive_fullscreen_configuration.h" |
21 #include "chrome/test/base/in_process_browser_test.h" | 20 #include "chrome/test/base/in_process_browser_test.h" |
22 #include "ui/aura/client/aura_constants.h" | 21 #include "ui/aura/client/aura_constants.h" |
23 | 22 |
24 namespace { | 23 namespace { |
25 | 24 |
26 // Returns true if |window| is in immersive fullscreen. Infer whether |window| | 25 // Returns true if |window| is in immersive fullscreen. |
27 // is in immersive fullscreen based on whether kFullscreenUsesMinimalChromeKey | |
28 // is set for |window| because DEPS does not allow the test to use BrowserView. | |
29 // (This is not quite right because if a window is in both immersive browser | |
30 // fullscreen and in tab fullscreen, kFullScreenUsesMinimalChromeKey will | |
31 // not be set). | |
32 bool IsInImmersiveFullscreen(BrowserWindow* browser_window) { | 26 bool IsInImmersiveFullscreen(BrowserWindow* browser_window) { |
33 return browser_window->IsFullscreen() && | 27 return ash::wm::GetWindowState(browser_window->GetNativeWindow())-> |
34 browser_window->GetNativeWindow()->GetProperty( | 28 IsImmersiveFullscreen(); |
35 ash::internal::kFullscreenUsesMinimalChromeKey); | |
36 } | 29 } |
37 | 30 |
38 } // namespace | 31 } // namespace |
39 | 32 |
40 typedef InProcessBrowserTest ChromeShellDelegateBrowserTest; | 33 typedef InProcessBrowserTest ChromeShellDelegateBrowserTest; |
41 | 34 |
42 // Confirm that toggling window miximized works properly | 35 // Confirm that toggling window miximized works properly |
43 IN_PROC_BROWSER_TEST_F(ChromeShellDelegateBrowserTest, ToggleMaximized) { | 36 IN_PROC_BROWSER_TEST_F(ChromeShellDelegateBrowserTest, ToggleMaximized) { |
44 ash::ShellDelegate* shell_delegate = ash::Shell::GetInstance()->delegate(); | 37 ash::ShellDelegate* shell_delegate = ash::Shell::GetInstance()->delegate(); |
45 ASSERT_TRUE(shell_delegate); | 38 ASSERT_TRUE(shell_delegate); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 175 |
183 shell_delegate->ToggleFullscreen(); | 176 shell_delegate->ToggleFullscreen(); |
184 EXPECT_TRUE(app_window->IsFullscreen()); | 177 EXPECT_TRUE(app_window->IsFullscreen()); |
185 | 178 |
186 shell_delegate->ToggleFullscreen(); | 179 shell_delegate->ToggleFullscreen(); |
187 EXPECT_FALSE(app_window->IsMaximized()); | 180 EXPECT_FALSE(app_window->IsMaximized()); |
188 EXPECT_FALSE(app_window->IsFullscreen()); | 181 EXPECT_FALSE(app_window->IsFullscreen()); |
189 | 182 |
190 CloseShellWindow(shell_window); | 183 CloseShellWindow(shell_window); |
191 } | 184 } |
OLD | NEW |