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 <algorithm> | 5 #include <algorithm> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "ash/common/accessibility_delegate.h" | 8 #include "ash/common/accessibility_delegate.h" |
9 #include "ash/common/accessibility_types.h" | 9 #include "ash/common/accessibility_types.h" |
10 #include "ash/common/ash_switches.h" | 10 #include "ash/common/ash_switches.h" |
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 gfx::Rect window_bounds(20, 10, 200, 300); | 1019 gfx::Rect window_bounds(20, 10, 200, 300); |
1020 aura::Window* root_window = Shell::GetPrimaryRootWindow(); | 1020 aura::Window* root_window = Shell::GetPrimaryRootWindow(); |
1021 std::unique_ptr<aura::Window> window(CreateWindow(window_bounds)); | 1021 std::unique_ptr<aura::Window> window(CreateWindow(window_bounds)); |
1022 | 1022 |
1023 gfx::Point point1(window_bounds.x() + 10, window_bounds.y() + 10); | 1023 gfx::Point point1(window_bounds.x() + 10, window_bounds.y() + 10); |
1024 | 1024 |
1025 ui::MouseEvent event1(ui::ET_MOUSE_PRESSED, point1, point1, | 1025 ui::MouseEvent event1(ui::ET_MOUSE_PRESSED, point1, point1, |
1026 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE); | 1026 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE); |
1027 | 1027 |
1028 ui::EventTarget* root_target = root_window; | 1028 ui::EventTarget* root_target = root_window; |
1029 ui::EventTargeter* targeter = | 1029 ui::EventTargeter* targeter = root_target->GetEventTargeter(); |
1030 root_window->GetHost()->dispatcher()->GetDefaultEventTargeter(); | |
1031 | 1030 |
1032 // The event should target the window because we are still not in overview | 1031 // The event should target the window because we are still not in overview |
1033 // mode. | 1032 // mode. |
1034 EXPECT_EQ(window.get(), targeter->FindTargetForEvent(root_target, &event1)); | 1033 EXPECT_EQ(window.get(), targeter->FindTargetForEvent(root_target, &event1)); |
1035 | 1034 |
1036 ToggleOverview(); | 1035 ToggleOverview(); |
1037 | 1036 |
1038 // The bounds have changed, take that into account. | 1037 // The bounds have changed, take that into account. |
1039 gfx::Rect bounds = GetTransformedBoundsInRootWindow(window.get()); | 1038 gfx::Rect bounds = GetTransformedBoundsInRootWindow(window.get()); |
1040 gfx::Point point2(bounds.x() + 10, bounds.y() + 10); | 1039 gfx::Point point2(bounds.x() + 10, bounds.y() + 10); |
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2127 aura::client::WINDOW_MOVE_SOURCE_MOUSE)); | 2126 aura::client::WINDOW_MOVE_SOURCE_MOUSE)); |
2128 ASSERT_TRUE(resizer.get()); | 2127 ASSERT_TRUE(resizer.get()); |
2129 gfx::Point location = resizer->GetInitialLocation(); | 2128 gfx::Point location = resizer->GetInitialLocation(); |
2130 location.Offset(20, 20); | 2129 location.Offset(20, 20); |
2131 resizer->Drag(location, 0); | 2130 resizer->Drag(location, 0); |
2132 ToggleOverview(); | 2131 ToggleOverview(); |
2133 resizer->RevertDrag(); | 2132 resizer->RevertDrag(); |
2134 } | 2133 } |
2135 | 2134 |
2136 } // namespace ash | 2135 } // namespace ash |
OLD | NEW |