Index: ui/aura_shell/drag_drop_controller.h |
diff --git a/ui/aura_shell/drag_drop_controller.h b/ui/aura_shell/drag_drop_controller.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ed6387f1d69747f1e2e6b3b1a7f32b5a5f2236aa |
--- /dev/null |
+++ b/ui/aura_shell/drag_drop_controller.h |
@@ -0,0 +1,76 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef UI_AURA_SHELL_DRAG_DROP_CONTROLLER_H_ |
+#define UI_AURA_SHELL_DRAG_DROP_CONTROLLER_H_ |
+#pragma once |
+ |
+#include "ui/aura_shell/aura_shell_export.h" |
+#include "ui/aura/client/drag_drop_client.h" |
+#include "ui/aura/event.h" |
+#include "ui/base/dragdrop/os_exchange_data.h" |
+#include "ui/gfx/point.h" |
+ |
+namespace aura { |
+class Window; |
+} |
+ |
+namespace ui{ |
+class OSExchangeData; |
+} |
+ |
+namespace views { |
+class Widget; |
+} |
+ |
+namespace aura_shell { |
+namespace internal { |
+ |
+namespace test { |
+class DragDropControllerTest; |
+} |
+ |
+class AURA_SHELL_EXPORT DragDropController : public aura::DragDropClient { |
+ public: |
+ DragDropController(); |
+ virtual ~DragDropController(); |
+ |
+ void set_should_block_during_drag_drop(bool should_block_during_drag_drop) { |
+ should_block_during_drag_drop_ = should_block_during_drag_drop; |
+ } |
+ |
+ // Overridden from aura::DragDropClient: |
+ virtual void StartDragAndDrop(const ui::OSExchangeData& data, |
+ int operation) OVERRIDE; |
+ virtual void DragUpdate(aura::Window* target, |
+ const aura::MouseEvent& event) OVERRIDE; |
+ virtual void Drop(aura::Window* target, |
+ const aura::MouseEvent& event) OVERRIDE; |
+ virtual void DragCancel() OVERRIDE; |
+ virtual bool IsDragAndDropInProgress() OVERRIDE; |
+ |
+ private: |
+ friend class test::DragDropControllerTest; |
+ |
+ // Helper method to reset everything. |
+ void Cleanup(); |
+ |
+ scoped_ptr<views::Widget> drag_widget_; |
Ben Goodger (Google)
2011/11/11 17:26:53
This would become:
scoped_ptr<DragImage> drag_ima
varunjain
2011/11/15 19:39:33
Done.
|
+ const ui::OSExchangeData* drag_data_; |
+ int drag_operation_; |
+ aura::Window* dragged_window_; |
+ |
+ bool drag_drop_in_progress_; |
+ |
+ // Indicates whether the caller should be blocked on a drag/drop session. |
+ // Only be used for tests. |
+ bool should_block_during_drag_drop_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(DragDropController); |
+}; |
+ |
+} // namespace internal |
+} // namespace aura_shell |
+ |
+#endif // UI_AURA_SHELL_DRAG_DROP_CONTROLLER_H_ |