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 "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" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 } | 107 } |
108 virtual ~AcceleratorCommandsFullscreenBrowserTest() { | 108 virtual ~AcceleratorCommandsFullscreenBrowserTest() { |
109 } | 109 } |
110 | 110 |
111 // BrowserTestBase override: | 111 // BrowserTestBase override: |
112 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 112 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
113 InProcessBrowserTest::SetUpCommandLine(command_line); | 113 InProcessBrowserTest::SetUpCommandLine(command_line); |
114 if (put_all_windows_in_immersive_) { | 114 if (put_all_windows_in_immersive_) { |
115 CommandLine::ForCurrentProcess()->AppendSwitch( | 115 CommandLine::ForCurrentProcess()->AppendSwitch( |
116 ash::switches::kAshEnableImmersiveFullscreenForAllWindows); | 116 ash::switches::kAshEnableImmersiveFullscreenForAllWindows); |
| 117 } else { |
| 118 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 119 ash::switches::kAshEnableImmersiveFullscreenForBrowserOnly); |
117 } | 120 } |
118 } | 121 } |
119 | 122 |
120 // Sets |window_state|'s show state to |initial_show_state_|. | 123 // Sets |window_state|'s show state to |initial_show_state_|. |
121 void SetToInitialShowState(ash::wm::WindowState* window_state) { | 124 void SetToInitialShowState(ash::wm::WindowState* window_state) { |
122 if (initial_show_state_ == ui::SHOW_STATE_MAXIMIZED) | 125 if (initial_show_state_ == ui::SHOW_STATE_MAXIMIZED) |
123 window_state->Maximize(); | 126 window_state->Maximize(); |
124 else | 127 else |
125 window_state->Restore(); | 128 window_state->Restore(); |
126 } | 129 } |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 return shell_window->GetBaseWindow()->IsMaximized(); | 299 return shell_window->GetBaseWindow()->IsMaximized(); |
297 else | 300 else |
298 return ui::BaseWindow::IsRestored(*shell_window->GetBaseWindow()); | 301 return ui::BaseWindow::IsRestored(*shell_window->GetBaseWindow()); |
299 } | 302 } |
300 | 303 |
301 // content::BrowserTestBase override: | 304 // content::BrowserTestBase override: |
302 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 305 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
303 if (put_all_windows_in_immersive_) { | 306 if (put_all_windows_in_immersive_) { |
304 CommandLine::ForCurrentProcess()->AppendSwitch( | 307 CommandLine::ForCurrentProcess()->AppendSwitch( |
305 ash::switches::kAshEnableImmersiveFullscreenForAllWindows); | 308 ash::switches::kAshEnableImmersiveFullscreenForAllWindows); |
| 309 } else { |
| 310 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 311 ash::switches::kAshEnableImmersiveFullscreenForBrowserOnly); |
306 } | 312 } |
307 extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line); | 313 extensions::PlatformAppBrowserTest::SetUpCommandLine(command_line); |
308 } | 314 } |
309 | 315 |
310 bool put_all_windows_in_immersive() const { | 316 bool put_all_windows_in_immersive() const { |
311 return put_all_windows_in_immersive_; | 317 return put_all_windows_in_immersive_; |
312 } | 318 } |
313 | 319 |
314 private: | 320 private: |
315 bool put_all_windows_in_immersive_; | 321 bool put_all_windows_in_immersive_; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 // cycles. | 402 // cycles. |
397 INSTANTIATE_TEST_CASE_P(InitiallyRestored, | 403 INSTANTIATE_TEST_CASE_P(InitiallyRestored, |
398 AcceleratorCommandsPlatformAppFullscreenBrowserTest, | 404 AcceleratorCommandsPlatformAppFullscreenBrowserTest, |
399 Combine(Values(false), | 405 Combine(Values(false), |
400 Values(ui::SHOW_STATE_NORMAL))); | 406 Values(ui::SHOW_STATE_NORMAL))); |
401 INSTANTIATE_TEST_CASE_P(InitiallyMaximized, | 407 INSTANTIATE_TEST_CASE_P(InitiallyMaximized, |
402 AcceleratorCommandsPlatformAppFullscreenBrowserTest, | 408 AcceleratorCommandsPlatformAppFullscreenBrowserTest, |
403 Combine(Values(false), | 409 Combine(Values(false), |
404 Values(ui::SHOW_STATE_MAXIMIZED))); | 410 Values(ui::SHOW_STATE_MAXIMIZED))); |
405 #endif | 411 #endif |
OLD | NEW |