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

Side by Side Diff: components/plugins/renderer/webview_plugin.cc

Issue 2501213002: Drag-and-drop: dragSourceEndedAt, dragSourceSystemDragEnded (Closed)
Patch Set: Rebased. Added check for !GetWebWidget(). 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
« no previous file with comments | « no previous file | components/test_runner/event_sender.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/plugins/renderer/webview_plugin.h" 5 #include "components/plugins/renderer/webview_plugin.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 if (container_) 238 if (container_)
239 container_->element().setAttribute("title", text); 239 container_->element().setAttribute("title", text);
240 } 240 }
241 241
242 void WebViewPlugin::startDragging(blink::WebReferrerPolicy, 242 void WebViewPlugin::startDragging(blink::WebReferrerPolicy,
243 const WebDragData&, 243 const WebDragData&,
244 WebDragOperationsMask, 244 WebDragOperationsMask,
245 const WebImage&, 245 const WebImage&,
246 const WebPoint&) { 246 const WebPoint&) {
247 // Immediately stop dragging. 247 // Immediately stop dragging.
248 web_view_->dragSourceSystemDragEnded(); 248 DCHECK(web_view_->mainFrame()->isWebLocalFrame());
249 web_view_->mainFrame()->toWebLocalFrame()->frameWidget()->
tommycli 2016/11/15 01:25:00 I assume frameWidget() is never null right?
paulmeyer 2016/11/15 01:42:54 Right. It can never be null here.
250 dragSourceSystemDragEnded();
249 } 251 }
250 252
251 bool WebViewPlugin::allowsBrokenNullLayerTreeView() const { 253 bool WebViewPlugin::allowsBrokenNullLayerTreeView() const {
252 return true; 254 return true;
253 } 255 }
254 256
255 void WebViewPlugin::didInvalidateRect(const WebRect& rect) { 257 void WebViewPlugin::didInvalidateRect(const WebRect& rect) {
256 if (container_) 258 if (container_)
257 container_->invalidateRect(rect); 259 container_->invalidateRect(rect);
258 } 260 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 if (!delegate_) 312 if (!delegate_)
311 return; 313 return;
312 314
313 // The delegate may instantiate a new plugin. 315 // The delegate may instantiate a new plugin.
314 delegate_->OnUnobscuredRectUpdate(gfx::Rect(unobscured_rect)); 316 delegate_->OnUnobscuredRectUpdate(gfx::Rect(unobscured_rect));
315 // The delegate may have dirtied style and layout of the WebView. 317 // The delegate may have dirtied style and layout of the WebView.
316 // See for example the resizePoster function in plugin_poster.html. 318 // See for example the resizePoster function in plugin_poster.html.
317 // Run the lifecycle now so that it is clean. 319 // Run the lifecycle now so that it is clean.
318 web_view_->updateAllLifecyclePhases(); 320 web_view_->updateAllLifecyclePhases();
319 } 321 }
OLDNEW
« no previous file with comments | « no previous file | components/test_runner/event_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698