OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/drag_drop/drag_drop_controller.h" | 5 #include "ash/drag_drop/drag_drop_controller.h" |
6 | 6 |
7 #include "ash/drag_drop/drag_drop_tracker.h" | 7 #include "ash/drag_drop/drag_drop_tracker.h" |
8 #include "ash/drag_drop/drag_image_view.h" | 8 #include "ash/drag_drop/drag_image_view.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 views::View* contents_view = widget->GetContentsView(); | 266 views::View* contents_view = widget->GetContentsView(); |
267 contents_view->AddChildView(view); | 267 contents_view->AddChildView(view); |
268 view->SetBounds(contents_view->width(), 0, 100, 100); | 268 view->SetBounds(contents_view->width(), 0, 100, 100); |
269 gfx::Rect contents_view_bounds = contents_view->bounds(); | 269 gfx::Rect contents_view_bounds = contents_view->bounds(); |
270 contents_view_bounds.Union(view->bounds()); | 270 contents_view_bounds.Union(view->bounds()); |
271 contents_view->SetBoundsRect(contents_view_bounds); | 271 contents_view->SetBoundsRect(contents_view_bounds); |
272 widget->SetBounds(contents_view_bounds); | 272 widget->SetBounds(contents_view_bounds); |
273 } | 273 } |
274 | 274 |
275 void DispatchGesture(ui::EventType gesture_type, gfx::Point location) { | 275 void DispatchGesture(ui::EventType gesture_type, gfx::Point location) { |
276 ui::GestureEventDetails event_details(gesture_type); | 276 ui::GestureEventDetails event_details(gesture_type, 0, 0); |
277 event_details.set_oldest_touch_id(1); | 277 event_details.set_oldest_touch_id(1); |
278 ui::GestureEvent gesture_event( | 278 ui::GestureEvent gesture_event( |
279 location.x(), location.y(), 0, ui::EventTimeForNow(), event_details); | 279 location.x(), location.y(), 0, ui::EventTimeForNow(), event_details); |
280 ui::EventSource* event_source = | 280 ui::EventSource* event_source = |
281 Shell::GetPrimaryRootWindow()->GetHost()->GetEventSource(); | 281 Shell::GetPrimaryRootWindow()->GetHost()->GetEventSource(); |
282 ui::EventSourceTestApi event_source_test(event_source); | 282 ui::EventSourceTestApi event_source_test(event_source); |
283 ui::EventDispatchDetails details = | 283 ui::EventDispatchDetails details = |
284 event_source_test.SendEventToProcessor(&gesture_event); | 284 event_source_test.SendEventToProcessor(&gesture_event); |
285 CHECK(!details.dispatcher_destroyed); | 285 CHECK(!details.dispatcher_destroyed); |
286 } | 286 } |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 EXPECT_EQ("405,405", observer.window_location_on_destroying().ToString()); | 1075 EXPECT_EQ("405,405", observer.window_location_on_destroying().ToString()); |
1076 } | 1076 } |
1077 for (aura::Window::Windows::iterator iter = root_windows.begin(); | 1077 for (aura::Window::Windows::iterator iter = root_windows.begin(); |
1078 iter != root_windows.end(); ++iter) { | 1078 iter != root_windows.end(); ++iter) { |
1079 aura::client::SetDragDropClient(*iter, NULL); | 1079 aura::client::SetDragDropClient(*iter, NULL); |
1080 } | 1080 } |
1081 } | 1081 } |
1082 | 1082 |
1083 } // namespace test | 1083 } // namespace test |
1084 } // namespace aura | 1084 } // namespace aura |
OLD | NEW |