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