Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 } |
| OLD | NEW |