| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/system/overview/overview_button_tray.h" | 5 #include "ash/system/overview/overview_button_tray.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/rotator/screen_rotation_animator.h" | 10 #include "ash/rotator/screen_rotation_animator.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 std::unique_ptr<ui::ScopedAnimationDurationScaleMode> hide_duration( | 237 std::unique_ptr<ui::ScopedAnimationDurationScaleMode> hide_duration( |
| 238 new ui::ScopedAnimationDurationScaleMode( | 238 new ui::ScopedAnimationDurationScaleMode( |
| 239 ui::ScopedAnimationDurationScaleMode::SLOW_DURATION)); | 239 ui::ScopedAnimationDurationScaleMode::SLOW_DURATION)); |
| 240 GetTray()->SetVisible(false); | 240 GetTray()->SetVisible(false); |
| 241 | 241 |
| 242 // ScreenRotationAnimator copies the current layers, and deletes them upon | 242 // ScreenRotationAnimator copies the current layers, and deletes them upon |
| 243 // completion. Allow its animation to complete first. | 243 // completion. Allow its animation to complete first. |
| 244 std::unique_ptr<ui::ScopedAnimationDurationScaleMode> rotate_duration( | 244 std::unique_ptr<ui::ScopedAnimationDurationScaleMode> rotate_duration( |
| 245 new ui::ScopedAnimationDurationScaleMode( | 245 new ui::ScopedAnimationDurationScaleMode( |
| 246 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); | 246 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); |
| 247 ash::ScreenRotationAnimator(gfx::Display::InternalDisplayId()) | 247 ash::ScreenRotationAnimator(display::Display::InternalDisplayId()) |
| 248 .Rotate(gfx::Display::ROTATE_270, gfx::Display::ROTATION_SOURCE_ACTIVE); | 248 .Rotate(display::Display::ROTATE_270, |
| 249 display::Display::ROTATION_SOURCE_ACTIVE); |
| 249 | 250 |
| 250 RunAllPendingInMessageLoop(); | 251 RunAllPendingInMessageLoop(); |
| 251 EXPECT_FALSE(GetTray()->visible()); | 252 EXPECT_FALSE(GetTray()->visible()); |
| 252 } | 253 } |
| 253 | 254 |
| 254 // Tests that the overview button becomes visible when the user enters | 255 // Tests that the overview button becomes visible when the user enters |
| 255 // maximize mode with a system modal window open, and that it hides once | 256 // maximize mode with a system modal window open, and that it hides once |
| 256 // the user exits maximize mode. | 257 // the user exits maximize mode. |
| 257 TEST_F(OverviewButtonTrayTest, VisibilityChangesForSystemModalWindow) { | 258 TEST_F(OverviewButtonTrayTest, VisibilityChangesForSystemModalWindow) { |
| 258 // TODO(jonross): When CreateTestWindow*() have been unified, use the | 259 // TODO(jonross): When CreateTestWindow*() have been unified, use the |
| (...skipping 10 matching lines...) Expand all Loading... |
| 269 ->maximize_mode_controller() | 270 ->maximize_mode_controller() |
| 270 ->EnableMaximizeModeWindowManager(true); | 271 ->EnableMaximizeModeWindowManager(true); |
| 271 EXPECT_TRUE(GetTray()->visible()); | 272 EXPECT_TRUE(GetTray()->visible()); |
| 272 Shell::GetInstance() | 273 Shell::GetInstance() |
| 273 ->maximize_mode_controller() | 274 ->maximize_mode_controller() |
| 274 ->EnableMaximizeModeWindowManager(false); | 275 ->EnableMaximizeModeWindowManager(false); |
| 275 EXPECT_FALSE(GetTray()->visible()); | 276 EXPECT_FALSE(GetTray()->visible()); |
| 276 } | 277 } |
| 277 | 278 |
| 278 } // namespace ash | 279 } // namespace ash |
| OLD | NEW |