OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef ASH_DRAG_DROP_DRAG_DROP_TRACKER_H_ | |
6 #define ASH_DRAG_DROP_DRAG_DROP_TRACKER_H_ | |
7 | |
8 #include "ash/ash_export.h" | |
9 #include "base/basictypes.h" | |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "ui/base/event.h" | |
12 | |
13 namespace aura { | |
14 class RootWindow; | |
15 class Window; | |
16 } | |
17 | |
18 namespace ash { | |
19 namespace internal { | |
20 | |
21 // Provides functions for handling drag events inside and outside the root | |
22 // window where drag is started. This internally sets up a capture window for | |
23 // tracking drag events outside the root window where drag is initiated. | |
24 class ASH_EXPORT DragDropTracker { | |
25 public: | |
26 DragDropTracker(aura::RootWindow* root_window); | |
varunjain
2012/08/24 13:00:54
explicit
mazda
2012/08/24 18:52:37
Done.
| |
27 ~DragDropTracker(); | |
28 | |
29 // Gets the target located at |event| in the coordinates of the root window | |
30 // given to the constructor. | |
31 aura::Window* GetTarget(const ui::LocatedEvent& event); | |
32 | |
33 // Converts the locations of |event| in the coordinates of the root window | |
34 // given to the constructor to the ones in |target|'s coordinates. | |
35 // Caller takes ownership of the returned object. | |
36 ui::MouseEvent* ConvertMouseEvent(aura::Window* target, | |
37 const ui::MouseEvent& event); | |
38 | |
39 private: | |
40 // A window for capturing drag events while dragging. | |
41 scoped_ptr<aura::Window> capture_window_; | |
42 | |
43 DISALLOW_COPY_AND_ASSIGN(DragDropTracker); | |
44 }; | |
45 | |
46 } // namespace internal | |
47 } // namespace ash | |
48 | |
49 #endif // ASH_DRAG_DROP_DRAG_DROP_TRACKER_H_ | |
OLD | NEW |