OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ash/test/immersive_fullscreen_controller_test_api.h" |
| 6 |
| 7 #include "ash/common/wm/immersive/wm_immersive_fullscreen_controller_delegate.h" |
| 8 #include "ash/wm/immersive_fullscreen_controller.h" |
| 9 #include "ui/aura/env.h" |
| 10 #include "ui/gfx/geometry/rect.h" |
| 11 |
| 12 namespace ash { |
| 13 |
| 14 ImmersiveFullscreenControllerTestApi::ImmersiveFullscreenControllerTestApi( |
| 15 ImmersiveFullscreenController* controller) |
| 16 : immersive_fullscreen_controller_(controller) {} |
| 17 |
| 18 ImmersiveFullscreenControllerTestApi::~ImmersiveFullscreenControllerTestApi() {} |
| 19 |
| 20 void ImmersiveFullscreenControllerTestApi::SetupForTest() { |
| 21 DCHECK(!immersive_fullscreen_controller_->enabled_); |
| 22 immersive_fullscreen_controller_->animations_disabled_for_test_ = true; |
| 23 |
| 24 // Move the mouse off of the top-of-window views so that it does not keep the |
| 25 // top-of-window views revealed. |
| 26 std::vector<gfx::Rect> bounds_in_screen( |
| 27 immersive_fullscreen_controller_->delegate_->GetVisibleBoundsInScreen()); |
| 28 DCHECK(!bounds_in_screen.empty()); |
| 29 int bottommost_in_screen = bounds_in_screen[0].bottom(); |
| 30 for (size_t i = 1; i < bounds_in_screen.size(); ++i) { |
| 31 if (bounds_in_screen[i].bottom() > bottommost_in_screen) |
| 32 bottommost_in_screen = bounds_in_screen[i].bottom(); |
| 33 } |
| 34 gfx::Point cursor_pos(0, bottommost_in_screen + 10); |
| 35 aura::Env::GetInstance()->set_last_mouse_location(cursor_pos); |
| 36 immersive_fullscreen_controller_->UpdateLocatedEventRevealedLock(); |
| 37 } |
| 38 |
| 39 } // namespace ash |
OLD | NEW |