| 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_CONTROLLER_H_ | 5 #ifndef ASH_DRAG_DROP_DRAG_DROP_CONTROLLER_H_ |
| 6 #define ASH_DRAG_DROP_DRAG_DROP_CONTROLLER_H_ | 6 #define ASH_DRAG_DROP_DRAG_DROP_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "ui/aura/window_observer.h" | 11 #include "ui/aura/window_observer.h" |
| 12 #include "ui/base/dragdrop/os_exchange_data.h" | 12 #include "ui/base/dragdrop/os_exchange_data.h" |
| 13 #include "ui/events/event_constants.h" | 13 #include "ui/events/event_constants.h" |
| 14 #include "ui/events/event_handler.h" | 14 #include "ui/events/event_handler.h" |
| 15 #include "ui/gfx/animation/animation_delegate.h" | 15 #include "ui/gfx/animation/animation_delegate.h" |
| 16 #include "ui/gfx/rect.h" | 16 #include "ui/gfx/rect.h" |
| 17 #include "ui/wm/public/drag_drop_client.h" | 17 #include "ui/wm/public/drag_drop_client.h" |
| 18 | 18 |
| 19 namespace gfx { | 19 namespace gfx { |
| 20 class LinearAnimation; | 20 class LinearAnimation; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace ash { | 23 namespace ash { |
| 24 class DragDropTracker; |
| 25 class DragDropTrackerDelegate; |
| 26 class DragImageView; |
| 24 | 27 |
| 25 namespace test { | 28 namespace test { |
| 26 class DragDropControllerTest; | 29 class DragDropControllerTest; |
| 27 } | 30 } |
| 28 | 31 |
| 29 namespace internal { | |
| 30 | |
| 31 class DragDropTracker; | |
| 32 class DragDropTrackerDelegate; | |
| 33 class DragImageView; | |
| 34 | |
| 35 class ASH_EXPORT DragDropController | 32 class ASH_EXPORT DragDropController |
| 36 : public aura::client::DragDropClient, | 33 : public aura::client::DragDropClient, |
| 37 public ui::EventHandler, | 34 public ui::EventHandler, |
| 38 public gfx::AnimationDelegate, | 35 public gfx::AnimationDelegate, |
| 39 public aura::WindowObserver { | 36 public aura::WindowObserver { |
| 40 public: | 37 public: |
| 41 DragDropController(); | 38 DragDropController(); |
| 42 virtual ~DragDropController(); | 39 virtual ~DragDropController(); |
| 43 | 40 |
| 44 void set_should_block_during_drag_drop(bool should_block_during_drag_drop) { | 41 void set_should_block_during_drag_drop(bool should_block_during_drag_drop) { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // Window that started the drag. | 112 // Window that started the drag. |
| 116 aura::Window* drag_source_window_; | 113 aura::Window* drag_source_window_; |
| 117 | 114 |
| 118 // Indicates whether the caller should be blocked on a drag/drop session. | 115 // Indicates whether the caller should be blocked on a drag/drop session. |
| 119 // Only be used for tests. | 116 // Only be used for tests. |
| 120 bool should_block_during_drag_drop_; | 117 bool should_block_during_drag_drop_; |
| 121 | 118 |
| 122 // Closure for quitting nested message loop. | 119 // Closure for quitting nested message loop. |
| 123 base::Closure quit_closure_; | 120 base::Closure quit_closure_; |
| 124 | 121 |
| 125 scoped_ptr<ash::internal::DragDropTracker> drag_drop_tracker_; | 122 scoped_ptr<ash::DragDropTracker> drag_drop_tracker_; |
| 126 scoped_ptr<DragDropTrackerDelegate> drag_drop_window_delegate_; | 123 scoped_ptr<DragDropTrackerDelegate> drag_drop_window_delegate_; |
| 127 | 124 |
| 128 ui::DragDropTypes::DragEventSource current_drag_event_source_; | 125 ui::DragDropTypes::DragEventSource current_drag_event_source_; |
| 129 | 126 |
| 130 // Holds a synthetic long tap event to be sent to the |drag_source_window_|. | 127 // Holds a synthetic long tap event to be sent to the |drag_source_window_|. |
| 131 // See comment in OnGestureEvent() on why we need this. | 128 // See comment in OnGestureEvent() on why we need this. |
| 132 scoped_ptr<ui::GestureEvent> pending_long_tap_; | 129 scoped_ptr<ui::GestureEvent> pending_long_tap_; |
| 133 | 130 |
| 134 base::WeakPtrFactory<DragDropController> weak_factory_; | 131 base::WeakPtrFactory<DragDropController> weak_factory_; |
| 135 | 132 |
| 136 DISALLOW_COPY_AND_ASSIGN(DragDropController); | 133 DISALLOW_COPY_AND_ASSIGN(DragDropController); |
| 137 }; | 134 }; |
| 138 | 135 |
| 139 } // namespace internal | |
| 140 } // namespace ash | 136 } // namespace ash |
| 141 | 137 |
| 142 #endif // ASH_DRAG_DROP_DRAG_DROP_CONTROLLER_H_ | 138 #endif // ASH_DRAG_DROP_DRAG_DROP_CONTROLLER_H_ |
| OLD | NEW |