Chromium Code Reviews| 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 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_DRAG_DEST_GTK_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_DRAG_DEST_GTK_H_ |
| 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_DRAG_DEST_GTK_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_DRAG_DEST_GTK_H_ |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 // update the system drag cursor. | 34 // update the system drag cursor. |
| 35 void UpdateDragStatus(WebKit::WebDragOperation operation); | 35 void UpdateDragStatus(WebKit::WebDragOperation operation); |
| 36 | 36 |
| 37 // Informs the renderer when a system drag has left the render view. | 37 // Informs the renderer when a system drag has left the render view. |
| 38 // See OnDragLeave(). | 38 // See OnDragLeave(). |
| 39 void DragLeave(); | 39 void DragLeave(); |
| 40 | 40 |
| 41 WebDragDestDelegate* delegate() const { return delegate_; } | 41 WebDragDestDelegate* delegate() const { return delegate_; } |
| 42 void set_delegate(WebDragDestDelegate* delegate) { delegate_ = delegate; } | 42 void set_delegate(WebDragDestDelegate* delegate) { delegate_ = delegate; } |
| 43 | 43 |
| 44 GtkWidget* widget() const { return widget_; } | |
| 45 | |
| 44 private: | 46 private: |
| 45 RenderViewHostImpl* GetRenderViewHost() const; | 47 RenderViewHostImpl* GetRenderViewHost() const; |
| 46 | 48 |
| 47 // Called when a system drag crosses over the render view. As there is no drag | 49 // Called when a system drag crosses over the render view. As there is no drag |
| 48 // enter event, we treat it as an enter event (and not a regular motion event) | 50 // enter event, we treat it as an enter event (and not a regular motion event) |
| 49 // when |context_| is NULL. | 51 // when |context_| is NULL. |
| 50 CHROMEGTK_CALLBACK_4(WebDragDestGtk, gboolean, OnDragMotion, GdkDragContext*, | 52 CHROMEGTK_CALLBACK_4(WebDragDestGtk, gboolean, OnDragMotion, GdkDragContext*, |
| 51 gint, gint, guint); | 53 gint, gint, guint); |
| 52 | 54 |
| 53 // We make a series of requests for the drag data when the drag first enters | 55 // We make a series of requests for the drag data when the drag first enters |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 83 // source. | 85 // source. |
| 84 int data_requests_; | 86 int data_requests_; |
| 85 | 87 |
| 86 // The last time we sent a message to the renderer related to a drag motion. | 88 // The last time we sent a message to the renderer related to a drag motion. |
| 87 gint drag_over_time_; | 89 gint drag_over_time_; |
| 88 | 90 |
| 89 // Whether the cursor is over a drop target, according to the last message we | 91 // Whether the cursor is over a drop target, according to the last message we |
| 90 // got from the renderer. | 92 // got from the renderer. |
| 91 bool is_drop_target_; | 93 bool is_drop_target_; |
| 92 | 94 |
| 93 // Handler ID for the destroy signal handler. We connect to the destroy | 95 // Stores Handler IDs for the gtk signal handlers. We have to cancel the the |
|
Charlie Reis
2013/03/14 22:08:38
typo: the the
mthiesse
2013/03/15 15:26:49
Done.
| |
| 94 // signal handler so that we won't call dest_unset on it after it is | 96 // signal handlers when this WebDragDestGtk is deleted so that if, later on, |
| 95 // destroyed, but we have to cancel the handler if we are destroyed before | 97 // we re-create the drag dest with the same same widget that we don't get |
|
Charlie Reis
2013/03/14 22:08:38
so that if we later recreate...
typo: same same
"
mthiesse
2013/03/15 15:26:49
Done.
| |
| 96 // |widget_| is. | 98 // callbacks to deleted functions. |
| 97 int destroy_handler_; | 99 scoped_array<int> handlers_; |
| 98 | 100 |
| 99 // A delegate that can receive drag information about drag events. | 101 // A delegate that can receive drag information about drag events. |
| 100 WebDragDestDelegate* delegate_; | 102 WebDragDestDelegate* delegate_; |
| 101 | 103 |
| 102 base::WeakPtrFactory<WebDragDestGtk> method_factory_; | 104 base::WeakPtrFactory<WebDragDestGtk> method_factory_; |
| 103 | 105 |
| 104 DISALLOW_COPY_AND_ASSIGN(WebDragDestGtk); | 106 DISALLOW_COPY_AND_ASSIGN(WebDragDestGtk); |
| 105 }; | 107 }; |
| 106 | 108 |
| 107 } // namespace content | 109 } // namespace content |
| 108 | 110 |
| 109 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_DRAG_DEST_GTK_H_ | 111 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_DRAG_DEST_GTK_H_ |
| OLD | NEW |