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