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

Side by Side Diff: content/browser/web_contents/web_contents_view_child_frame.cc

Issue 2626073007: Make drag-and-drop work with OOPIF-WebView. (Closed)
Patch Set: Function rename. Created 3 years, 11 months 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
« no previous file with comments | « content/browser/web_contents/web_contents_view_child_frame.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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 #include "content/browser/web_contents/web_contents_view_child_frame.h" 5 #include "content/browser/web_contents/web_contents_view_child_frame.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" 8 #include "content/browser/frame_host/render_widget_host_view_child_frame.h"
9 #include "content/browser/web_contents/web_contents_impl.h" 9 #include "content/browser/web_contents/web_contents_impl.h"
10 #include "content/public/browser/web_contents_view_delegate.h" 10 #include "content/public/browser/web_contents_view_delegate.h"
(...skipping 17 matching lines...) Expand all
28 WebContentsViewChildFrame::~WebContentsViewChildFrame() {} 28 WebContentsViewChildFrame::~WebContentsViewChildFrame() {}
29 29
30 WebContentsView* WebContentsViewChildFrame::GetOuterView() { 30 WebContentsView* WebContentsViewChildFrame::GetOuterView() {
31 return web_contents_->GetOuterWebContents()->GetView(); 31 return web_contents_->GetOuterWebContents()->GetView();
32 } 32 }
33 33
34 const WebContentsView* WebContentsViewChildFrame::GetOuterView() const { 34 const WebContentsView* WebContentsViewChildFrame::GetOuterView() const {
35 return web_contents_->GetOuterWebContents()->GetView(); 35 return web_contents_->GetOuterWebContents()->GetView();
36 } 36 }
37 37
38 RenderViewHostDelegateView* WebContentsViewChildFrame::GetOuterDelegateView() {
39 RenderViewHostImpl* outer_rvh = static_cast<RenderViewHostImpl*>(
40 web_contents_->GetOuterWebContents()->GetRenderViewHost());
41 CHECK(outer_rvh);
42 return outer_rvh->GetDelegate()->GetDelegateView();
43 }
44
38 gfx::NativeView WebContentsViewChildFrame::GetNativeView() const { 45 gfx::NativeView WebContentsViewChildFrame::GetNativeView() const {
39 return GetOuterView()->GetNativeView(); 46 return GetOuterView()->GetNativeView();
40 } 47 }
41 48
42 gfx::NativeView WebContentsViewChildFrame::GetContentNativeView() const { 49 gfx::NativeView WebContentsViewChildFrame::GetContentNativeView() const {
43 return GetOuterView()->GetContentNativeView(); 50 return GetOuterView()->GetContentNativeView();
44 } 51 }
45 52
46 gfx::NativeWindow WebContentsViewChildFrame::GetTopLevelNativeWindow() const { 53 gfx::NativeWindow WebContentsViewChildFrame::GetTopLevelNativeWindow() const {
47 return GetOuterView()->GetTopLevelNativeWindow(); 54 return GetOuterView()->GetTopLevelNativeWindow();
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 void WebContentsViewChildFrame::StoreFocus() { 144 void WebContentsViewChildFrame::StoreFocus() {
138 NOTREACHED(); 145 NOTREACHED();
139 } 146 }
140 147
141 DropData* WebContentsViewChildFrame::GetDropData() const { 148 DropData* WebContentsViewChildFrame::GetDropData() const {
142 NOTREACHED(); 149 NOTREACHED();
143 return nullptr; 150 return nullptr;
144 } 151 }
145 152
146 void WebContentsViewChildFrame::UpdateDragCursor(WebDragOperation operation) { 153 void WebContentsViewChildFrame::UpdateDragCursor(WebDragOperation operation) {
147 NOTREACHED(); 154 if (auto view = GetOuterDelegateView())
155 view->UpdateDragCursor(operation);
148 } 156 }
149 157
150 void WebContentsViewChildFrame::GotFocus() { 158 void WebContentsViewChildFrame::GotFocus() {
151 NOTREACHED(); 159 NOTREACHED();
152 } 160 }
153 161
154 void WebContentsViewChildFrame::TakeFocus(bool reverse) { 162 void WebContentsViewChildFrame::TakeFocus(bool reverse) {
155 // TODO(avallee): http://crbug.com/610819 Advance focus to next element in 163 // TODO(avallee): http://crbug.com/610819 Advance focus to next element in
156 // outer WebContents. 164 // outer WebContents.
157 } 165 }
158 166
159 void WebContentsViewChildFrame::ShowContextMenu( 167 void WebContentsViewChildFrame::ShowContextMenu(
160 RenderFrameHost* render_frame_host, 168 RenderFrameHost* render_frame_host,
161 const ContextMenuParams& params) { 169 const ContextMenuParams& params) {
162 NOTREACHED(); 170 NOTREACHED();
163 } 171 }
164 172
165 void WebContentsViewChildFrame::StartDragging( 173 void WebContentsViewChildFrame::StartDragging(
166 const DropData& drop_data, 174 const DropData& drop_data,
167 WebDragOperationsMask ops, 175 WebDragOperationsMask ops,
168 const gfx::ImageSkia& image, 176 const gfx::ImageSkia& image,
169 const gfx::Vector2d& image_offset, 177 const gfx::Vector2d& image_offset,
170 const DragEventSourceInfo& event_info, 178 const DragEventSourceInfo& event_info,
171 RenderWidgetHostImpl* source_rwh) { 179 RenderWidgetHostImpl* source_rwh) {
172 NOTREACHED(); 180 if (auto view = GetOuterDelegateView()) {
181 view->StartDragging(
182 drop_data, ops, image, image_offset, event_info, source_rwh);
183 } else {
184 web_contents_->GetOuterWebContents()->SystemDragEnded(source_rwh);
185 }
173 } 186 }
174 187
175 } // namespace content 188 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_view_child_frame.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698