OLD | NEW |
1 // Copyright (c) 2011 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_TAB_WEB_DRAG_SOURCE_GTK_H_ | 5 #ifndef CONTENT_BROWSER_TAB_WEB_DRAG_SOURCE_GTK_H_ |
6 #define CONTENT_BROWSER_TAB_WEB_DRAG_SOURCE_GTK_H_ | 6 #define CONTENT_BROWSER_TAB_WEB_DRAG_SOURCE_GTK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
14 #include "base/string16.h" | 14 #include "base/string16.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "googleurl/src/gurl.h" | 16 #include "googleurl/src/gurl.h" |
17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" |
18 #include "ui/base/gtk/gtk_signal.h" | 18 #include "ui/base/gtk/gtk_signal.h" |
19 #include "ui/base/gtk/gtk_signal_registrar.h" | 19 #include "ui/base/gtk/gtk_signal_registrar.h" |
20 #include "ui/gfx/native_widget_types.h" | 20 #include "ui/gfx/native_widget_types.h" |
21 #include "ui/gfx/point.h" | 21 #include "ui/gfx/point.h" |
22 | 22 |
| 23 class RenderViewHostImpl; |
23 class SkBitmap; | 24 class SkBitmap; |
24 struct WebDropData; | 25 struct WebDropData; |
25 | 26 |
26 namespace content { | 27 namespace content { |
27 | 28 |
28 class WebContents; | 29 class WebContents; |
29 | 30 |
30 // WebDragSourceGtk takes care of managing the drag from a WebContents | 31 // WebDragSourceGtk takes care of managing the drag from a WebContents |
31 // with Gtk. | 32 // with Gtk. |
32 class CONTENT_EXPORT WebDragSourceGtk : public MessageLoopForUI::Observer { | 33 class CONTENT_EXPORT WebDragSourceGtk : public MessageLoopForUI::Observer { |
(...skipping 18 matching lines...) Expand all Loading... |
51 GdkDragContext*, GtkDragResult); | 52 GdkDragContext*, GtkDragResult); |
52 CHROMEGTK_CALLBACK_1(WebDragSourceGtk, void, OnDragBegin, | 53 CHROMEGTK_CALLBACK_1(WebDragSourceGtk, void, OnDragBegin, |
53 GdkDragContext*); | 54 GdkDragContext*); |
54 CHROMEGTK_CALLBACK_1(WebDragSourceGtk, void, OnDragEnd, | 55 CHROMEGTK_CALLBACK_1(WebDragSourceGtk, void, OnDragEnd, |
55 GdkDragContext*); | 56 GdkDragContext*); |
56 CHROMEGTK_CALLBACK_4(WebDragSourceGtk, void, OnDragDataGet, | 57 CHROMEGTK_CALLBACK_4(WebDragSourceGtk, void, OnDragDataGet, |
57 GdkDragContext*, GtkSelectionData*, guint, guint); | 58 GdkDragContext*, GtkSelectionData*, guint, guint); |
58 CHROMEGTK_CALLBACK_1(WebDragSourceGtk, gboolean, OnDragIconExpose, | 59 CHROMEGTK_CALLBACK_1(WebDragSourceGtk, gboolean, OnDragIconExpose, |
59 GdkEventExpose*); | 60 GdkEventExpose*); |
60 | 61 |
| 62 RenderViewHostImpl* GetRenderViewHost() const; |
61 gfx::NativeView GetContentNativeView() const; | 63 gfx::NativeView GetContentNativeView() const; |
62 | 64 |
63 // The tab we're manging the drag for. | 65 // The tab we're manging the drag for. |
64 content::WebContents* web_contents_; | 66 content::WebContents* web_contents_; |
65 | 67 |
66 // The drop data for the current drag (for drags that originate in the render | 68 // The drop data for the current drag (for drags that originate in the render |
67 // view). Non-NULL iff there is a current drag. | 69 // view). Non-NULL iff there is a current drag. |
68 scoped_ptr<WebDropData> drop_data_; | 70 scoped_ptr<WebDropData> drop_data_; |
69 | 71 |
70 // The image used for depicting the drag, and the offset between the cursor | 72 // The image used for depicting the drag, and the offset between the cursor |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 GtkWidget* drag_icon_; | 106 GtkWidget* drag_icon_; |
105 | 107 |
106 ui::GtkSignalRegistrar signals_; | 108 ui::GtkSignalRegistrar signals_; |
107 | 109 |
108 DISALLOW_COPY_AND_ASSIGN(WebDragSourceGtk); | 110 DISALLOW_COPY_AND_ASSIGN(WebDragSourceGtk); |
109 }; | 111 }; |
110 | 112 |
111 } // namespace content | 113 } // namespace content |
112 | 114 |
113 #endif // CONTENT_BROWSER_TAB_WEB_DRAG_SOURCE_GTK_H_ | 115 #endif // CONTENT_BROWSER_TAB_WEB_DRAG_SOURCE_GTK_H_ |
OLD | NEW |