| 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/wm/gestures/overview_gesture_handler.h" | 5 #include "ash/wm/gestures/overview_gesture_handler.h" |
| 6 | 6 |
| 7 #include "ash/common/wm/overview/window_selector_controller.h" | 7 #include "ash/common/wm/overview/window_selector_controller.h" |
| 8 #include "ash/common/wm_shell.h" | |
| 9 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 10 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 11 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
| 12 #include "ash/wm/window_util.h" | 11 #include "ash/wm/window_util.h" |
| 13 #include "ui/aura/test/test_window_delegate.h" | 12 #include "ui/aura/test/test_window_delegate.h" |
| 14 #include "ui/aura/test/test_windows.h" | 13 #include "ui/aura/test/test_windows.h" |
| 15 #include "ui/aura/window.h" | 14 #include "ui/aura/window.h" |
| 16 #include "ui/aura/window_event_dispatcher.h" | 15 #include "ui/aura/window_event_dispatcher.h" |
| 17 #include "ui/events/test/event_generator.h" | 16 #include "ui/events/test/event_generator.h" |
| 18 #include "ui/views/widget/widget.h" | 17 #include "ui/views/widget/widget.h" |
| 19 | 18 |
| 20 namespace ash { | 19 namespace ash { |
| 21 | 20 |
| 22 class OverviewGestureHandlerTest : public test::AshTestBase { | 21 class OverviewGestureHandlerTest : public test::AshTestBase { |
| 23 public: | 22 public: |
| 24 OverviewGestureHandlerTest() {} | 23 OverviewGestureHandlerTest() {} |
| 25 ~OverviewGestureHandlerTest() override {} | 24 ~OverviewGestureHandlerTest() override {} |
| 26 | 25 |
| 27 aura::Window* CreateWindow(const gfx::Rect& bounds) { | 26 aura::Window* CreateWindow(const gfx::Rect& bounds) { |
| 28 return CreateTestWindowInShellWithDelegate(&delegate_, -1, bounds); | 27 return CreateTestWindowInShellWithDelegate(&delegate_, -1, bounds); |
| 29 } | 28 } |
| 30 | 29 |
| 31 void ToggleOverview() { | 30 void ToggleOverview() { |
| 32 WmShell::Get()->window_selector_controller()->ToggleOverview(); | 31 Shell::Get()->window_selector_controller()->ToggleOverview(); |
| 33 } | 32 } |
| 34 | 33 |
| 35 bool IsSelecting() { | 34 bool IsSelecting() { |
| 36 return WmShell::Get()->window_selector_controller()->IsSelecting(); | 35 return Shell::Get()->window_selector_controller()->IsSelecting(); |
| 37 } | 36 } |
| 38 | 37 |
| 39 float vertical_threshold_pixels() const { | 38 float vertical_threshold_pixels() const { |
| 40 return OverviewGestureHandler::vertical_threshold_pixels_; | 39 return OverviewGestureHandler::vertical_threshold_pixels_; |
| 41 } | 40 } |
| 42 | 41 |
| 43 float horizontal_threshold_pixels() const { | 42 float horizontal_threshold_pixels() const { |
| 44 return OverviewGestureHandler::horizontal_threshold_pixels_; | 43 return OverviewGestureHandler::horizontal_threshold_pixels_; |
| 45 } | 44 } |
| 46 | 45 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 generator.Dispatch(&move); | 171 generator.Dispatch(&move); |
| 173 } | 172 } |
| 174 | 173 |
| 175 EXPECT_FALSE(IsSelecting()); | 174 EXPECT_FALSE(IsSelecting()); |
| 176 ui::ScrollEvent fling_start(ui::ET_SCROLL_FLING_START, start, timestamp, 0, 0, | 175 ui::ScrollEvent fling_start(ui::ET_SCROLL_FLING_START, start, timestamp, 0, 0, |
| 177 10, 0, 10, num_fingers); | 176 10, 0, 10, num_fingers); |
| 178 generator.Dispatch(&fling_start); | 177 generator.Dispatch(&fling_start); |
| 179 } | 178 } |
| 180 | 179 |
| 181 } // namespace ash | 180 } // namespace ash |
| OLD | NEW |