Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: content/browser/web_contents/web_contents_view_aura.h

Issue 2505113002: Drag-and-drop: Target drag messages to specific RenderWidgets. (Closed)
Patch Set: Small fix. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_VIEW_AURA_H_ 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_
6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ 6 #define CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/gtest_prod_util.h" 11 #include "base/gtest_prod_util.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/memory/weak_ptr.h"
14 #include "content/browser/renderer_host/overscroll_controller_delegate.h" 15 #include "content/browser/renderer_host/overscroll_controller_delegate.h"
15 #include "content/browser/renderer_host/render_view_host_delegate_view.h" 16 #include "content/browser/renderer_host/render_view_host_delegate_view.h"
16 #include "content/browser/web_contents/web_contents_view.h" 17 #include "content/browser/web_contents/web_contents_view.h"
17 #include "content/common/content_export.h" 18 #include "content/common/content_export.h"
18 #include "ui/aura/client/drag_drop_delegate.h" 19 #include "ui/aura/client/drag_drop_delegate.h"
19 #include "ui/aura/window_delegate.h" 20 #include "ui/aura/window_delegate.h"
20 #include "ui/aura/window_observer.h" 21 #include "ui/aura/window_observer.h"
21 22
22 namespace aura { 23 namespace aura {
23 class Window; 24 class Window;
24 } 25 }
25 26
26 namespace ui { 27 namespace ui {
27 class DropTargetEvent; 28 class DropTargetEvent;
28 class TouchSelectionController; 29 class TouchSelectionController;
29 } 30 }
30 31
31 namespace content { 32 namespace content {
32 class GestureNavSimple; 33 class GestureNavSimple;
33 class OverscrollNavigationOverlay; 34 class OverscrollNavigationOverlay;
35 class RenderWidgetHostImpl;
34 class RenderWidgetHostViewAura; 36 class RenderWidgetHostViewAura;
35 class TouchSelectionControllerClientAura; 37 class TouchSelectionControllerClientAura;
36 class WebContentsViewDelegate; 38 class WebContentsViewDelegate;
37 class WebContentsImpl; 39 class WebContentsImpl;
38 class WebDragDestDelegate; 40 class WebDragDestDelegate;
39 41
40 class CONTENT_EXPORT WebContentsViewAura 42 class CONTENT_EXPORT WebContentsViewAura
41 : NON_EXPORTED_BASE(public WebContentsView), 43 : NON_EXPORTED_BASE(public WebContentsView),
42 public RenderViewHostDelegateView, 44 public RenderViewHostDelegateView,
43 public OverscrollControllerDelegate, 45 public OverscrollControllerDelegate,
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 void RenderViewSwappedIn(RenderViewHost* host) override; 112 void RenderViewSwappedIn(RenderViewHost* host) override;
111 void SetOverscrollControllerEnabled(bool enabled) override; 113 void SetOverscrollControllerEnabled(bool enabled) override;
112 114
113 // Overridden from RenderViewHostDelegateView: 115 // Overridden from RenderViewHostDelegateView:
114 void ShowContextMenu(RenderFrameHost* render_frame_host, 116 void ShowContextMenu(RenderFrameHost* render_frame_host,
115 const ContextMenuParams& params) override; 117 const ContextMenuParams& params) override;
116 void StartDragging(const DropData& drop_data, 118 void StartDragging(const DropData& drop_data,
117 blink::WebDragOperationsMask operations, 119 blink::WebDragOperationsMask operations,
118 const gfx::ImageSkia& image, 120 const gfx::ImageSkia& image,
119 const gfx::Vector2d& image_offset, 121 const gfx::Vector2d& image_offset,
120 const DragEventSourceInfo& event_info) override; 122 const DragEventSourceInfo& event_info,
123 RenderWidgetHostImpl* source_rwh) override;
121 void UpdateDragCursor(blink::WebDragOperation operation) override; 124 void UpdateDragCursor(blink::WebDragOperation operation) override;
122 void GotFocus() override; 125 void GotFocus() override;
123 void TakeFocus(bool reverse) override; 126 void TakeFocus(bool reverse) override;
124 #if defined(USE_EXTERNAL_POPUP_MENU) 127 #if defined(USE_EXTERNAL_POPUP_MENU)
125 void ShowPopupMenu(RenderFrameHost* render_frame_host, 128 void ShowPopupMenu(RenderFrameHost* render_frame_host,
126 const gfx::Rect& bounds, 129 const gfx::Rect& bounds,
127 int item_height, 130 int item_height,
128 double item_font_size, 131 double item_font_size,
129 int selected_item, 132 int selected_item,
130 const std::vector<MenuItem>& items, 133 const std::vector<MenuItem>& items,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 WebContentsImpl* web_contents_; 187 WebContentsImpl* web_contents_;
185 188
186 std::unique_ptr<WebContentsViewDelegate> delegate_; 189 std::unique_ptr<WebContentsViewDelegate> delegate_;
187 190
188 blink::WebDragOperationsMask current_drag_op_; 191 blink::WebDragOperationsMask current_drag_op_;
189 192
190 std::unique_ptr<DropData> current_drop_data_; 193 std::unique_ptr<DropData> current_drop_data_;
191 194
192 WebDragDestDelegate* drag_dest_delegate_; 195 WebDragDestDelegate* drag_dest_delegate_;
193 196
194 // We keep track of the render view host we're dragging over. If it changes 197 // We keep track of the RenderWidgetHost we're dragging over. If it changes
195 // during a drag, we need to re-send the DragEnter message. WARNING: 198 // during a drag, we need to re-send the DragEnter message.
196 // this pointer should never be dereferenced. We only use it for comparing 199 base::WeakPtr<RenderWidgetHostImpl> current_rwh_for_drag_;
197 // pointers. 200
201 // We also keep track of the RenderViewHost we're dragging over to avoid
202 // sending the drag exited message after leaving the current
203 // view. |current_rvh_for_drag_| should not be dereferenced.
198 void* current_rvh_for_drag_; 204 void* current_rvh_for_drag_;
199 205
206 // We keep track of the RenderWidgetHost from which the current drag started,
207 // in order to properly route the drag end message to it.
208 base::WeakPtr<RenderWidgetHostImpl> drag_start_rwh_;
209
200 // The overscroll gesture currently in progress. 210 // The overscroll gesture currently in progress.
201 OverscrollMode current_overscroll_gesture_; 211 OverscrollMode current_overscroll_gesture_;
202 212
203 // This is the completed overscroll gesture. This is used for the animation 213 // This is the completed overscroll gesture. This is used for the animation
204 // callback that happens in response to a completed overscroll gesture. 214 // callback that happens in response to a completed overscroll gesture.
205 OverscrollMode completed_overscroll_gesture_; 215 OverscrollMode completed_overscroll_gesture_;
206 216
207 // This manages the overlay window that shows the screenshot during a history 217 // This manages the overlay window that shows the screenshot during a history
208 // navigation triggered by the overscroll gesture. 218 // navigation triggered by the overscroll gesture.
209 std::unique_ptr<OverscrollNavigationOverlay> navigation_overlay_; 219 std::unique_ptr<OverscrollNavigationOverlay> navigation_overlay_;
210 220
211 std::unique_ptr<GestureNavSimple> gesture_nav_simple_; 221 std::unique_ptr<GestureNavSimple> gesture_nav_simple_;
212 222
213 bool init_rwhv_with_null_parent_for_testing_; 223 bool init_rwhv_with_null_parent_for_testing_;
214 224
215 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAura); 225 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAura);
216 }; 226 };
217 227
218 } // namespace content 228 } // namespace content
219 229
220 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_ 230 #endif // CONTENT_BROWSER_WEB_CONTENTS_WEB_CONTENTS_VIEW_AURA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698