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 VIEWS_WIDGET_DROP_TARGET_GTK_H_ | 5 #ifndef VIEWS_WIDGET_DROP_TARGET_GTK_H_ |
6 #define VIEWS_WIDGET_DROP_TARGET_GTK_H_ | 6 #define VIEWS_WIDGET_DROP_TARGET_GTK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 #include <set> | 10 #include <set> |
(...skipping 21 matching lines...) Expand all Loading... |
32 // ask for data as necessary. Some Views require data before they can determine | 32 // ask for data as necessary. Some Views require data before they can determine |
33 // if the drop is going to be allowed. When such a View is encountered the | 33 // if the drop is going to be allowed. When such a View is encountered the |
34 // relevant data is requested from the drag source. When the data is available | 34 // relevant data is requested from the drag source. When the data is available |
35 // the target is notified. Similarly if the drop completes and the data has | 35 // the target is notified. Similarly if the drop completes and the data has |
36 // not yet been fetched, it is fetched and the target then notified. | 36 // not yet been fetched, it is fetched and the target then notified. |
37 // | 37 // |
38 // When a drop finishes this class calls back to the containing NativeWidgetGtk | 38 // When a drop finishes this class calls back to the containing NativeWidgetGtk |
39 // which results in deleting the DropTargetGtk. | 39 // which results in deleting the DropTargetGtk. |
40 class DropTargetGtk { | 40 class DropTargetGtk { |
41 public: | 41 public: |
42 explicit DropTargetGtk(internal::RootView* root_view, | 42 DropTargetGtk(internal::RootView* root_view, GdkDragContext* context); |
43 GdkDragContext* context); | |
44 ~DropTargetGtk(); | 43 ~DropTargetGtk(); |
45 | 44 |
46 // If a drag and drop is underway and |view| is the current drop target, the | 45 // If a drag and drop is underway and |view| is the current drop target, the |
47 // drop target is set to null. | 46 // drop target is set to null. |
48 // This is invoked when a View is removed from the RootView to make sure | 47 // This is invoked when a View is removed from the RootView to make sure |
49 // we don't target a view that was removed during dnd. | 48 // we don't target a view that was removed during dnd. |
50 void ResetTargetViewIfEquals(View* view); | 49 void ResetTargetViewIfEquals(View* view); |
51 | 50 |
52 // Drop methods from Gtk. These are forwarded from the containing | 51 // Drop methods from Gtk. These are forwarded from the containing |
53 // NativeWidgetGtk. | 52 // NativeWidgetGtk. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 // helper_.target_view(). The two differ if the view under the mouse requires | 111 // helper_.target_view(). The two differ if the view under the mouse requires |
113 // the data. | 112 // the data. |
114 View* pending_view_; | 113 View* pending_view_; |
115 | 114 |
116 DISALLOW_COPY_AND_ASSIGN(DropTargetGtk); | 115 DISALLOW_COPY_AND_ASSIGN(DropTargetGtk); |
117 }; | 116 }; |
118 | 117 |
119 } // namespace views | 118 } // namespace views |
120 | 119 |
121 #endif // VIEWS_WIDGET_DROP_TARGET_GTK_H_ | 120 #endif // VIEWS_WIDGET_DROP_TARGET_GTK_H_ |
OLD | NEW |