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 CONTENT_BROWSER_WEB_CONTENTS_WEB_DRAG_SOURCE_WIN_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_DRAG_SOURCE_WIN_H_ |
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_DRAG_SOURCE_WIN_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_DRAG_SOURCE_WIN_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "content/public/browser/notification_observer.h" | 9 #include "content/public/browser/notification_observer.h" |
10 #include "content/public/browser/notification_registrar.h" | 10 #include "content/public/browser/notification_registrar.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 const NotificationSource& source, | 32 const NotificationSource& source, |
33 const NotificationDetails& details); | 33 const NotificationDetails& details); |
34 | 34 |
35 void set_effect(DWORD effect) { effect_ = effect; } | 35 void set_effect(DWORD effect) { effect_ = effect; } |
36 | 36 |
37 protected: | 37 protected: |
38 // ui::DragSourceWin | 38 // ui::DragSourceWin |
39 virtual void OnDragSourceCancel(); | 39 virtual void OnDragSourceCancel(); |
40 virtual void OnDragSourceDrop(); | 40 virtual void OnDragSourceDrop(); |
41 virtual void OnDragSourceMove(); | 41 virtual void OnDragSourceMove(); |
| 42 virtual bool ShouldDropDragSource(BOOL escape_pressed, DWORD key_state); |
42 | 43 |
43 private: | 44 private: |
44 // Cannot construct thusly. | 45 // Cannot construct thusly. |
45 WebDragSource(); | 46 WebDragSource(); |
46 | 47 |
47 // OnDragSourceDrop schedules its main work to be done after IDropTarget::Drop | 48 // OnDragSourceDrop schedules its main work to be done after IDropTarget::Drop |
48 // by posting a task to this function. | 49 // by posting a task to this function. |
49 void DelayedOnDragSourceDrop(); | 50 void DelayedOnDragSourceDrop(); |
50 | 51 |
| 52 void OnDragSourceEnded(); |
| 53 |
51 // Keep a reference to the window so we can translate the cursor position. | 54 // Keep a reference to the window so we can translate the cursor position. |
52 gfx::NativeWindow source_wnd_; | 55 gfx::NativeWindow source_wnd_; |
53 | 56 |
54 // We use this as a channel to the renderer to tell it about various drag | 57 // We use this as a channel to the renderer to tell it about various drag |
55 // drop events that it needs to know about (such as when a drag operation it | 58 // drop events that it needs to know about (such as when a drag operation it |
56 // initiated terminates). | 59 // initiated terminates). |
57 RenderViewHost* render_view_host_; | 60 RenderViewHost* render_view_host_; |
58 | 61 |
59 NotificationRegistrar registrar_; | 62 NotificationRegistrar registrar_; |
60 | 63 |
61 DWORD effect_; | 64 DWORD effect_; |
62 | 65 |
63 DISALLOW_COPY_AND_ASSIGN(WebDragSource); | 66 DISALLOW_COPY_AND_ASSIGN(WebDragSource); |
64 }; | 67 }; |
65 | 68 |
66 } // namespace content | 69 } // namespace content |
67 | 70 |
68 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_DRAG_SOURCE_WIN_H_ | 71 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_DRAG_SOURCE_WIN_H_ |
OLD | NEW |