| 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 |
| 95 // Programmatically send mouse down event for touch-initiated drag and drop. |
| 96 void SendMouseEventForTouchDnD(); |
| 97 |
| 94 // For debug check only. Access only on drag-and-drop thread. | 98 // For debug check only. Access only on drag-and-drop thread. |
| 95 base::PlatformThreadId drag_drop_thread_id_; | 99 base::PlatformThreadId drag_drop_thread_id_; |
| 96 | 100 |
| 97 // All the member variables below are accessed on UI thread. | 101 // All the member variables below are accessed on UI thread. |
| 98 | 102 |
| 99 gfx::NativeWindow source_window_; | 103 gfx::NativeWindow source_window_; |
| 100 WebContents* web_contents_; | 104 WebContents* web_contents_; |
| 101 WebDragDest* drag_dest_; | 105 WebDragDest* drag_dest_; |
| 102 | 106 |
| 103 // |drag_source_| is our callback interface passed to the system when we | 107 // |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 | 108 // want to initiate a drag and drop operation. We use it to tell if a |
| 105 // drag operation is happening. | 109 // drag operation is happening. |
| 106 scoped_refptr<WebDragSource> drag_source_; | 110 scoped_refptr<WebDragSource> drag_source_; |
| 107 | 111 |
| 108 // The thread used by the drag-out download. This is because we want to avoid | 112 // The thread used by the drag-out download. This is because we want to avoid |
| 109 // running nested message loop in main UI thread. | 113 // running nested message loop in main UI thread. |
| 110 scoped_ptr<DragDropThread> drag_drop_thread_; | 114 scoped_ptr<DragDropThread> drag_drop_thread_; |
| 111 | 115 |
| 112 // The flag to guard that EndDragging is not called twice. | 116 // The flag to guard that EndDragging is not called twice. |
| 113 bool drag_ended_; | 117 bool drag_ended_; |
| 114 | 118 |
| 115 base::Callback<void()> drag_end_callback_; | 119 base::Callback<void()> drag_end_callback_; |
| 116 | 120 |
| 117 DISALLOW_COPY_AND_ASSIGN(WebContentsDragWin); | 121 DISALLOW_COPY_AND_ASSIGN(WebContentsDragWin); |
| 118 }; | 122 }; |
| 119 | 123 |
| 120 } // namespace content | 124 } // namespace content |
| 121 | 125 |
| 122 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_DRAG_WIN_H_ | 126 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_DRAG_WIN_H_ |
| OLD | NEW |