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 #include "chrome/browser/tab_contents/web_drag_dest_gtk.h" | 5 #include "chrome/browser/tab_contents/web_drag_dest_gtk.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 if (context_) { | 83 if (context_) { |
84 is_drop_target_ = operation != WebDragOperationNone; | 84 is_drop_target_ = operation != WebDragOperationNone; |
85 gdk_drag_status(context_, gtk_util::WebDragOpToGdkDragAction(operation), | 85 gdk_drag_status(context_, gtk_util::WebDragOpToGdkDragAction(operation), |
86 drag_over_time_); | 86 drag_over_time_); |
87 } | 87 } |
88 } | 88 } |
89 | 89 |
90 void WebDragDestGtk::DragLeave() { | 90 void WebDragDestGtk::DragLeave() { |
91 tab_contents_->render_view_host()->DragTargetDragLeave(); | 91 tab_contents_->render_view_host()->DragTargetDragLeave(); |
92 | 92 |
93 DCHECK(tab_); | 93 // TODO(thestig) Turn back to DCHECKs after we figure out bug 89388. |
| 94 CHECK(tab_); |
| 95 CHECK(tab_->bookmark_tab_helper()); |
94 if (tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()) { | 96 if (tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()) { |
95 tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()->OnDragLeave( | 97 tab_->bookmark_tab_helper()->GetBookmarkDragDelegate()->OnDragLeave( |
96 bookmark_drag_data_); | 98 bookmark_drag_data_); |
97 } | 99 } |
98 } | 100 } |
99 | 101 |
100 gboolean WebDragDestGtk::OnDragMotion(GtkWidget* sender, | 102 gboolean WebDragDestGtk::OnDragMotion(GtkWidget* sender, |
101 GdkDragContext* context, | 103 GdkDragContext* context, |
102 gint x, gint y, | 104 gint x, gint y, |
103 guint time) { | 105 guint time) { |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 if (browser) | 298 if (browser) |
297 browser->window()->Show(); | 299 browser->window()->Show(); |
298 | 300 |
299 // The second parameter is just an educated guess as to whether or not the | 301 // The second parameter is just an educated guess as to whether or not the |
300 // drag succeeded, but at least we will get the drag-end animation right | 302 // drag succeeded, but at least we will get the drag-end animation right |
301 // sometimes. | 303 // sometimes. |
302 gtk_drag_finish(context, is_drop_target_, FALSE, time); | 304 gtk_drag_finish(context, is_drop_target_, FALSE, time); |
303 | 305 |
304 return TRUE; | 306 return TRUE; |
305 } | 307 } |
OLD | NEW |