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_tracker.h" | 5 #include "ash/drag_drop/drag_drop_tracker.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/wm/coordinate_conversion.h" | 9 #include "ash/wm/coordinate_conversion.h" |
| 10 #include "ui/aura/client/window_tree_client.h" |
10 #include "ui/aura/root_window.h" | 11 #include "ui/aura/root_window.h" |
11 #include "ui/events/event.h" | 12 #include "ui/events/event.h" |
12 #include "ui/gfx/screen.h" | 13 #include "ui/gfx/screen.h" |
13 | 14 |
14 namespace ash { | 15 namespace ash { |
15 namespace internal { | 16 namespace internal { |
16 | 17 |
17 namespace { | 18 namespace { |
18 | 19 |
19 // Creates a window for capturing drag events. | 20 // Creates a window for capturing drag events. |
20 aura::Window* CreateCaptureWindow(aura::RootWindow* context_root, | 21 aura::Window* CreateCaptureWindow(aura::RootWindow* context_root, |
21 aura::WindowDelegate* delegate) { | 22 aura::WindowDelegate* delegate) { |
22 aura::Window* window = new aura::Window(delegate); | 23 aura::Window* window = new aura::Window(delegate); |
23 window->SetType(aura::client::WINDOW_TYPE_NORMAL); | 24 window->SetType(aura::client::WINDOW_TYPE_NORMAL); |
24 window->Init(ui::LAYER_NOT_DRAWN); | 25 window->Init(ui::LAYER_NOT_DRAWN); |
25 window->SetDefaultParentByRootWindow(context_root, gfx::Rect()); | 26 aura::client::ParentWindowWithContext(window, context_root, gfx::Rect()); |
26 window->Show(); | 27 window->Show(); |
27 DCHECK(window->bounds().size().IsEmpty()); | 28 DCHECK(window->bounds().size().IsEmpty()); |
28 return window; | 29 return window; |
29 } | 30 } |
30 | 31 |
31 } // namespace | 32 } // namespace |
32 | 33 |
33 DragDropTracker::DragDropTracker(aura::RootWindow* context_root, | 34 DragDropTracker::DragDropTracker(aura::RootWindow* context_root, |
34 aura::WindowDelegate* delegate) | 35 aura::WindowDelegate* delegate) |
35 : capture_window_(CreateCaptureWindow(context_root, delegate)) { | 36 : capture_window_(CreateCaptureWindow(context_root, delegate)) { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 ash::wm::GetRootWindowAt(location_in_screen), | 71 ash::wm::GetRootWindowAt(location_in_screen), |
71 &target_root_location); | 72 &target_root_location); |
72 return new ui::MouseEvent(event.type(), | 73 return new ui::MouseEvent(event.type(), |
73 target_location, | 74 target_location, |
74 target_root_location, | 75 target_root_location, |
75 event.flags()); | 76 event.flags()); |
76 } | 77 } |
77 | 78 |
78 } // namespace internal | 79 } // namespace internal |
79 } // namespace ash | 80 } // namespace ash |
OLD | NEW |