OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_TAB_CONTENTS_WEB_DRAG_DEST_DELEGATE_H_ | 5 #ifndef CONTENT_BROWSER_TAB_CONTENTS_WEB_DRAG_DEST_DELEGATE_H_ |
6 #define CONTENT_BROWSER_TAB_CONTENTS_WEB_DRAG_DEST_DELEGATE_H_ | 6 #define CONTENT_BROWSER_TAB_CONTENTS_WEB_DRAG_DEST_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #if defined(TOOLKIT_USES_GTK) | 9 #if defined(TOOLKIT_USES_GTK) |
10 #include <gtk/gtk.h> | 10 #include <gtk/gtk.h> |
11 #endif // TOOLKIT_USES_GTK | 11 #endif // TOOLKIT_USES_GTK |
12 | 12 |
13 #include "base/string16.h" | 13 #include "base/string16.h" |
14 #include "content/common/content_export.h" | 14 |
| 15 #if defined(OS_WIN) |
| 16 #include "ui/base/dragdrop/drop_target.h" |
| 17 #endif |
15 | 18 |
16 class GURL; | 19 class GURL; |
17 | 20 |
18 namespace content { | 21 namespace content { |
19 | 22 |
20 class WebContents; | 23 class WebContents; |
21 | 24 |
22 // An optional delegate that listens for drags of bookmark data. | 25 // An optional delegate that listens for drags of bookmark data. |
23 class CONTENT_EXPORT WebDragDestDelegate { | 26 class WebDragDestDelegate { |
24 public: | 27 public: |
25 // Announces that a drag has started. It's valid that a drag starts, along | 28 // Announces that a drag has started. It's valid that a drag starts, along |
26 // with over/enter/leave/drop notifications without receiving any bookmark | 29 // with over/enter/leave/drop notifications without receiving any bookmark |
27 // data. | 30 // data. |
28 virtual void DragInitialize(WebContents* contents) = 0; | 31 virtual void DragInitialize(WebContents* contents) = 0; |
29 | 32 |
30 // Notifications of drag progression. | 33 // Notifications of drag progression. |
| 34 #if defined(OS_WIN) |
| 35 virtual void OnDragOver(IDataObject* data_object) = 0; |
| 36 virtual void OnDragEnter(IDataObject* data_object) = 0; |
| 37 virtual void OnDrop(IDataObject* data_object) = 0; |
| 38 virtual void OnDragLeave(IDataObject* data_object) = 0; |
| 39 #else |
31 virtual void OnDragOver() = 0; | 40 virtual void OnDragOver() = 0; |
32 virtual void OnDragEnter() = 0; | 41 virtual void OnDragEnter() = 0; |
33 virtual void OnDrop() = 0; | 42 virtual void OnDrop() = 0; |
| 43 // This should also clear any state kept about this drag. |
| 44 virtual void OnDragLeave() = 0; |
| 45 #endif |
34 | 46 |
35 #if defined(TOOLKIT_USES_GTK) | 47 #if defined(TOOLKIT_USES_GTK) |
36 // Returns the bookmark atom type. GTK and Views return different values here. | 48 // Returns the bookmark atom type. GTK and Views return different values here. |
37 virtual GdkAtom GetBookmarkTargetAtom() const = 0; | 49 virtual GdkAtom GetBookmarkTargetAtom() const = 0; |
38 | 50 |
39 // Called when WebDragDestkGtk detects that there's bookmark data in a | 51 // Called when WebDragDestkGtk detects that there's bookmark data in a |
40 // drag. Not every drag will trigger these. | 52 // drag. Not every drag will trigger these. |
41 virtual void OnReceiveDataFromGtk(GtkSelectionData* data) = 0; | 53 virtual void OnReceiveDataFromGtk(GtkSelectionData* data) = 0; |
42 virtual void OnReceiveProcessedData(const GURL& url, | 54 virtual void OnReceiveProcessedData(const GURL& url, |
43 const string16& title) = 0; | 55 const string16& title) = 0; |
44 #endif // TOOLKIT_USES_GTK | 56 #endif // TOOLKIT_USES_GTK |
45 | 57 |
46 // This should also clear any state kept about this drag. | |
47 virtual void OnDragLeave() = 0; | |
48 | |
49 virtual ~WebDragDestDelegate() {} | 58 virtual ~WebDragDestDelegate() {} |
50 }; | 59 }; |
51 | 60 |
52 } // namespace content | 61 } // namespace content |
53 | 62 |
54 #endif // CONTENT_BROWSER_TAB_CONTENTS_WEB_DRAG_DEST_DELEGATE_H_ | 63 #endif // CONTENT_BROWSER_TAB_CONTENTS_WEB_DRAG_DEST_DELEGATE_H_ |
OLD | NEW |