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_CONTENTS_DRAG_WIN_H_ | 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_DRAG_WIN_H_ |
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_DRAG_WIN_H_ | 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_DRAG_WIN_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 void StartBackgroundDragging(const WebDropData& drop_data, | 84 void StartBackgroundDragging(const WebDropData& drop_data, |
85 WebKit::WebDragOperationsMask ops, | 85 WebKit::WebDragOperationsMask ops, |
86 const GURL& page_url, | 86 const GURL& page_url, |
87 const std::string& page_encoding, | 87 const std::string& page_encoding, |
88 const gfx::ImageSkia& image, | 88 const gfx::ImageSkia& image, |
89 const gfx::Vector2d& image_offset); | 89 const gfx::Vector2d& image_offset); |
90 // Called on UI thread. | 90 // Called on UI thread. |
91 void EndDragging(); | 91 void EndDragging(); |
92 void CloseThread(); | 92 void CloseThread(); |
93 | 93 |
| 94 // Programmatically send mouse down event for touch-initiated drag and drop. |
| 95 void SendMouseEventForTouchDnD(); |
| 96 |
94 // For debug check only. Access only on drag-and-drop thread. | 97 // For debug check only. Access only on drag-and-drop thread. |
95 base::PlatformThreadId drag_drop_thread_id_; | 98 base::PlatformThreadId drag_drop_thread_id_; |
96 | 99 |
97 // All the member variables below are accessed on UI thread. | 100 // All the member variables below are accessed on UI thread. |
98 | 101 |
99 gfx::NativeWindow source_window_; | 102 gfx::NativeWindow source_window_; |
100 WebContents* web_contents_; | 103 WebContents* web_contents_; |
101 WebDragDest* drag_dest_; | 104 WebDragDest* drag_dest_; |
102 | 105 |
103 // |drag_source_| is our callback interface passed to the system when we | 106 // |drag_source_| is our callback interface passed to the system when we |
104 // want to initiate a drag and drop operation. We use it to tell if a | 107 // want to initiate a drag and drop operation. We use it to tell if a |
105 // drag operation is happening. | 108 // drag operation is happening. |
106 scoped_refptr<WebDragSource> drag_source_; | 109 scoped_refptr<WebDragSource> drag_source_; |
107 | 110 |
108 // The thread used by the drag-out download. This is because we want to avoid | 111 // The thread used by the drag-out download. This is because we want to avoid |
109 // running nested message loop in main UI thread. | 112 // running nested message loop in main UI thread. |
110 scoped_ptr<DragDropThread> drag_drop_thread_; | 113 scoped_ptr<DragDropThread> drag_drop_thread_; |
111 | 114 |
112 // The flag to guard that EndDragging is not called twice. | 115 // The flag to guard that EndDragging is not called twice. |
113 bool drag_ended_; | 116 bool drag_ended_; |
114 | 117 |
115 base::Callback<void()> drag_end_callback_; | 118 base::Callback<void()> drag_end_callback_; |
116 | 119 |
117 DISALLOW_COPY_AND_ASSIGN(WebContentsDragWin); | 120 DISALLOW_COPY_AND_ASSIGN(WebContentsDragWin); |
118 }; | 121 }; |
119 | 122 |
120 } // namespace content | 123 } // namespace content |
121 | 124 |
122 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_DRAG_WIN_H_ | 125 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_DRAG_WIN_H_ |
OLD | NEW |