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 #include "content/browser/web_contents/web_drag_dest_gtk.h" | 5 #include "content/browser/web_contents/web_drag_dest_gtk.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 GDK_ACTION_MOVE)); | 40 GDK_ACTION_MOVE)); |
41 g_signal_connect(widget, "drag-motion", | 41 g_signal_connect(widget, "drag-motion", |
42 G_CALLBACK(OnDragMotionThunk), this); | 42 G_CALLBACK(OnDragMotionThunk), this); |
43 g_signal_connect(widget, "drag-leave", | 43 g_signal_connect(widget, "drag-leave", |
44 G_CALLBACK(OnDragLeaveThunk), this); | 44 G_CALLBACK(OnDragLeaveThunk), this); |
45 g_signal_connect(widget, "drag-drop", | 45 g_signal_connect(widget, "drag-drop", |
46 G_CALLBACK(OnDragDropThunk), this); | 46 G_CALLBACK(OnDragDropThunk), this); |
47 g_signal_connect(widget, "drag-data-received", | 47 g_signal_connect(widget, "drag-data-received", |
48 G_CALLBACK(OnDragDataReceivedThunk), this); | 48 G_CALLBACK(OnDragDataReceivedThunk), this); |
49 // TODO(tony): Need a drag-data-delete handler for moving content out of | 49 // TODO(tony): Need a drag-data-delete handler for moving content out of |
50 // the tab contents. http://crbug.com/38989 | 50 // the WebContents. http://crbug.com/38989 |
51 | 51 |
52 destroy_handler_ = g_signal_connect( | 52 destroy_handler_ = g_signal_connect( |
53 widget, "destroy", G_CALLBACK(gtk_widget_destroyed), &widget_); | 53 widget, "destroy", G_CALLBACK(gtk_widget_destroyed), &widget_); |
54 } | 54 } |
55 | 55 |
56 WebDragDestGtk::~WebDragDestGtk() { | 56 WebDragDestGtk::~WebDragDestGtk() { |
57 if (widget_) { | 57 if (widget_) { |
58 gtk_drag_dest_unset(widget_); | 58 gtk_drag_dest_unset(widget_); |
59 g_signal_handler_disconnect(widget_, destroy_handler_); | 59 g_signal_handler_disconnect(widget_, destroy_handler_); |
60 } | 60 } |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 gtk_drag_finish(context, is_drop_target_, FALSE, time); | 267 gtk_drag_finish(context, is_drop_target_, FALSE, time); |
268 | 268 |
269 return TRUE; | 269 return TRUE; |
270 } | 270 } |
271 | 271 |
272 RenderViewHostImpl* WebDragDestGtk::GetRenderViewHost() const { | 272 RenderViewHostImpl* WebDragDestGtk::GetRenderViewHost() const { |
273 return static_cast<RenderViewHostImpl*>(web_contents_->GetRenderViewHost()); | 273 return static_cast<RenderViewHostImpl*>(web_contents_->GetRenderViewHost()); |
274 } | 274 } |
275 | 275 |
276 } // namespace content | 276 } // namespace content |
OLD | NEW |