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/accelerators/accelerator_commands.h" | 9 #include "ash/accelerators/accelerator_commands.h" |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
12 #include "ash/shell_delegate.h" | 12 #include "ash/shell_delegate.h" |
13 #include "ash/wm/window_properties.h" | |
14 #include "ash/wm/window_state.h" | 13 #include "ash/wm/window_state.h" |
15 #include "base/command_line.h" | 14 #include "base/command_line.h" |
16 #include "chrome/browser/apps/app_browsertest_util.h" | 15 #include "chrome/browser/apps/app_browsertest_util.h" |
17 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
18 #include "chrome/browser/ui/browser_commands.h" | 17 #include "chrome/browser/ui/browser_commands.h" |
19 #include "chrome/browser/ui/browser_finder.h" | 18 #include "chrome/browser/ui/browser_finder.h" |
20 #include "chrome/browser/ui/browser_window.h" | 19 #include "chrome/browser/ui/browser_window.h" |
21 #include "chrome/browser/ui/immersive_fullscreen_configuration.h" | 20 #include "chrome/browser/ui/immersive_fullscreen_configuration.h" |
22 #include "chrome/test/base/in_process_browser_test.h" | 21 #include "chrome/test/base/in_process_browser_test.h" |
23 #include "ui/aura/client/aura_constants.h" | 22 #include "ui/aura/client/aura_constants.h" |
24 | 23 |
25 namespace { | 24 namespace { |
26 | 25 |
27 // Returns true if |window| is in immersive fullscreen. Infer whether |window| | 26 // Returns true if |window| is in immersive fullscreen. |
28 // is in immersive fullscreen based on whether kFullscreenUsesMinimalChromeKey | |
29 // is set for |window| because DEPS does not allow the test to use BrowserView. | |
30 // (This is not quite right because if a window is in both immersive browser | |
31 // fullscreen and in tab fullscreen, kFullScreenUsesMinimalChromeKey will | |
32 // not be set). | |
33 bool IsInImmersiveFullscreen(BrowserWindow* browser_window) { | 27 bool IsInImmersiveFullscreen(BrowserWindow* browser_window) { |
34 return browser_window->IsFullscreen() && | 28 return ash::wm::GetWindowState(browser_window->GetNativeWindow())-> |
35 browser_window->GetNativeWindow()->GetProperty( | 29 IsImmersiveFullscreen(); |
36 ash::internal::kFullscreenUsesMinimalChromeKey); | |
37 } | 30 } |
38 | 31 |
39 } // namespace | 32 } // namespace |
40 | 33 |
41 typedef InProcessBrowserTest ChromeShellDelegateBrowserTest; | 34 typedef InProcessBrowserTest ChromeShellDelegateBrowserTest; |
42 | 35 |
43 // TODO(oshima): Move these tests to ash once ToggleFullscreen is moved | 36 // TODO(oshima): Move these tests to ash once ToggleFullscreen is moved |
44 // to ash. crbug.com/309837. | 37 // to ash. crbug.com/309837. |
45 | 38 |
46 // Confirm that toggling window miximized works properly | 39 // Confirm that toggling window miximized works properly |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 | 179 |
187 shell_delegate->ToggleFullscreen(); | 180 shell_delegate->ToggleFullscreen(); |
188 EXPECT_TRUE(app_window->IsFullscreen()); | 181 EXPECT_TRUE(app_window->IsFullscreen()); |
189 | 182 |
190 shell_delegate->ToggleFullscreen(); | 183 shell_delegate->ToggleFullscreen(); |
191 EXPECT_FALSE(app_window->IsMaximized()); | 184 EXPECT_FALSE(app_window->IsMaximized()); |
192 EXPECT_FALSE(app_window->IsFullscreen()); | 185 EXPECT_FALSE(app_window->IsFullscreen()); |
193 | 186 |
194 CloseShellWindow(shell_window); | 187 CloseShellWindow(shell_window); |
195 } | 188 } |
OLD | NEW |