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

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: added missing test file 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 ui{
20 class OSExchangeData;
21 }
22
23 namespace views {
24 class Widget;
25 }
26
27 namespace aura_shell {
28 namespace internal {
29
30 namespace test {
31 class DragDropControllerTest;
32 }
33
34 class AURA_SHELL_EXPORT DragDropController : public aura::DragDropClient {
35 public:
36 DragDropController();
37 virtual ~DragDropController();
38
39 void set_should_block_during_drag_drop(bool should_block_during_drag_drop) {
40 should_block_during_drag_drop_ = should_block_during_drag_drop;
41 }
42
43 // Overridden from aura::DragDropClient:
44 virtual void StartDragAndDrop(const ui::OSExchangeData& data,
45 int operation) OVERRIDE;
46 virtual void DragUpdate(aura::Window* target,
47 const aura::MouseEvent& event) OVERRIDE;
48 virtual void Drop(aura::Window* target,
49 const aura::MouseEvent& event) OVERRIDE;
50 virtual void DragCancel() OVERRIDE;
51 virtual bool IsDragAndDropInProgress() OVERRIDE;
52
53 private:
54 friend class test::DragDropControllerTest;
55
56 // Helper method to reset everything.
57 void Cleanup();
58
59 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.
60 const ui::OSExchangeData* drag_data_;
61 int drag_operation_;
62 aura::Window* dragged_window_;
63
64 bool drag_drop_in_progress_;
65
66 // Indicates whether the caller should be blocked on a drag/drop session.
67 // Only be used for tests.
68 bool should_block_during_drag_drop_;
69
70 DISALLOW_COPY_AND_ASSIGN(DragDropController);
71 };
72
73 } // namespace internal
74 } // namespace aura_shell
75
76 #endif // UI_AURA_SHELL_DRAG_DROP_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698