| 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 #ifndef ASH_DRAG_DROP_DRAG_DROP_TRACKER_H_ | 5 #ifndef ASH_DRAG_DROP_DRAG_DROP_TRACKER_H_ |
| 6 #define ASH_DRAG_DROP_DRAG_DROP_TRACKER_H_ | 6 #define ASH_DRAG_DROP_DRAG_DROP_TRACKER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "ui/events/event.h" | 12 #include "ui/events/event.h" |
| 13 | 13 |
| 14 namespace aura { | 14 namespace aura { |
| 15 class Window; | 15 class Window; |
| 16 class WindowDelegate; | 16 class WindowDelegate; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace ash { | 19 namespace ash { |
| 20 | 20 |
| 21 // Provides functions for handling drag events inside and outside the root | 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 | 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. | 23 // tracking drag events outside the root window where drag is initiated. |
| 24 // ash/wm/coordinate_conversion.h is used internally and only X11 environment | 24 // Only X11 environment is supported for now. |
| 25 // is supported for now. | |
| 26 class ASH_EXPORT DragDropTracker { | 25 class ASH_EXPORT DragDropTracker { |
| 27 public: | 26 public: |
| 28 DragDropTracker(aura::Window* context_root, | 27 DragDropTracker(aura::Window* context_root, |
| 29 aura::WindowDelegate* delegate); | 28 aura::WindowDelegate* delegate); |
| 30 ~DragDropTracker(); | 29 ~DragDropTracker(); |
| 31 | 30 |
| 32 aura::Window* capture_window() { return capture_window_.get(); } | 31 aura::Window* capture_window() { return capture_window_.get(); } |
| 33 | 32 |
| 34 // Tells our |capture_window_| to take capture. This is not done right at | 33 // Tells our |capture_window_| to take capture. This is not done right at |
| 35 // creation to give the caller a chance to perform any operations needed | 34 // creation to give the caller a chance to perform any operations needed |
| (...skipping 13 matching lines...) Expand all Loading... |
| 49 private: | 48 private: |
| 50 // A window for capturing drag events while dragging. | 49 // A window for capturing drag events while dragging. |
| 51 std::unique_ptr<aura::Window> capture_window_; | 50 std::unique_ptr<aura::Window> capture_window_; |
| 52 | 51 |
| 53 DISALLOW_COPY_AND_ASSIGN(DragDropTracker); | 52 DISALLOW_COPY_AND_ASSIGN(DragDropTracker); |
| 54 }; | 53 }; |
| 55 | 54 |
| 56 } // namespace ash | 55 } // namespace ash |
| 57 | 56 |
| 58 #endif // ASH_DRAG_DROP_DRAG_DROP_TRACKER_H_ | 57 #endif // ASH_DRAG_DROP_DRAG_DROP_TRACKER_H_ |
| OLD | NEW |