Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: ui/aura_shell/drag_drop_controller.h

Issue 8450018: First shot at implementing drag&drop for Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor changes Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 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 UI_AURA_SHELL_DRAG_DROP_CONTROLLER_H_
6 #define UI_AURA_SHELL_DRAG_DROP_CONTROLLER_H_
7 #pragma once
8
9 #include "ui/aura_shell/aura_shell_export.h"
10 #include "ui/aura/client/drag_drop_client.h"
11 #include "ui/aura/event.h"
12 #include "ui/base/dragdrop/os_exchange_data.h"
13 #include "ui/gfx/point.h"
14
15 namespace aura {
16 class Window;
17 }
18
19 namespace aura_shell {
20 namespace internal {
21
22 class DragImageView;
23 namespace test {
24 class DragDropControllerTest;
25 }
26
27 class AURA_SHELL_EXPORT DragDropController : public aura::DragDropClient {
28 public:
29 DragDropController();
30 virtual ~DragDropController();
31
32 void set_should_block_during_drag_drop(bool should_block_during_drag_drop) {
33 should_block_during_drag_drop_ = should_block_during_drag_drop;
34 }
35
36 // Overridden from aura::DragDropClient:
37 virtual void StartDragAndDrop(const ui::OSExchangeData& data,
38 int operation) OVERRIDE;
39 virtual void DragUpdate(aura::Window* target,
40 const aura::MouseEvent& event) OVERRIDE;
41 virtual void Drop(aura::Window* target,
42 const aura::MouseEvent& event) OVERRIDE;
43 virtual void DragCancel() OVERRIDE;
44 virtual bool IsDragAndDropInProgress() OVERRIDE;
45
46 private:
47 friend class test::DragDropControllerTest;
48
49 // Helper method to reset everything.
50 void Cleanup();
51
52 scoped_ptr<DragImageView> drag_image_;
53 const ui::OSExchangeData* drag_data_;
54 int drag_operation_;
55 aura::Window* dragged_window_;
56
57 bool drag_drop_in_progress_;
58
59 // Indicates whether the caller should be blocked on a drag/drop session.
60 // Only be used for tests.
61 bool should_block_during_drag_drop_;
62
63 DISALLOW_COPY_AND_ASSIGN(DragDropController);
64 };
65
66 } // namespace internal
67 } // namespace aura_shell
68
69 #endif // UI_AURA_SHELL_DRAG_DROP_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698