Chromium Code Reviews| 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 "ui/base/event.h" | |
| 11 | |
| 12 namespace aura { | |
| 13 class RootWindow; | |
| 14 class Window; | |
| 15 } | |
| 16 | |
| 17 namespace ash { | |
| 18 namespace internal { | |
| 19 | |
| 20 class ASH_EXPORT DragDropTracker { | |
|
varunjain
2012/08/20 16:21:22
some comments about what this is for would be nice
mazda
2012/08/21 02:10:59
Done.
| |
| 21 public: | |
| 22 DragDropTracker(); | |
|
sky
2012/08/20 15:35:18
Can we create this with a specific RootWindow and
mazda
2012/08/21 02:10:59
Done.
| |
| 23 ~DragDropTracker(); | |
| 24 | |
| 25 // Starts tracking the drag events sent to |root_window|. | |
| 26 void StartTracking(aura::RootWindow* root_window); | |
| 27 | |
| 28 // Stop tracking drag events. | |
| 29 void StopTracking(); | |
| 30 | |
| 31 // Gets the target located at |event| in the coordinates of the root window | |
| 32 // given to StartTracking. | |
| 33 aura::Window* GetTarget(const ui::LocatedEvent& event); | |
| 34 | |
| 35 // Converts the locations of |event| in the coordinates of the root window | |
| 36 // given to StartTracking to the ones in |target|'s coordinates. | |
| 37 // Caller takes ownership of the returned object. | |
| 38 ui::MouseEvent* ConvertMouseEvent(aura::Window* target, | |
| 39 const ui::MouseEvent& event); | |
| 40 | |
| 41 private: | |
| 42 // A window for capturing drag events while dragging. | |
| 43 aura::Window* capture_window_; | |
| 44 | |
| 45 DISALLOW_COPY_AND_ASSIGN(DragDropTracker); | |
| 46 }; | |
| 47 | |
| 48 } // namespace internal | |
| 49 } // namespace ash | |
| 50 | |
| 51 #endif // ASH_DRAG_DROP_DRAG_DROP_TRACKER_H_ | |
| OLD | NEW |