Index: third_party/WebKit/Source/core/frame/LocalFrame.cpp |
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp |
index 6e6ca09fc502cf82686a4eef346e100a1c46d0c3..a2cfe177ecebc0a10d6731f42e26099bba02269f 100644 |
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp |
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp |
@@ -762,29 +762,32 @@ double LocalFrame::DevicePixelRatio() const { |
// TODO(tanvir.rizvi): NodeImage is used only by DataTransfer, |
// and is irrelevant to LocalFrame core functionality, so it can be moved to |
// DataTransfer. |
-std::unique_ptr<DragImage> LocalFrame::NodeImage(Node& node) { |
- DraggedNodeImageBuilder image_node(*this, node); |
+std::unique_ptr<DragImage> LocalFrame::NodeImage(const LocalFrame& frame, |
Xiaocheng
2017/06/14 18:15:30
This is different from our common workflow. What w
|
+ Node& node) { |
+ DraggedNodeImageBuilder image_node(frame, node); |
return image_node.CreateImage(); |
} |
// TODO(tanvir.rizvi): DragImageForSelection is used only by DragController, |
// and is irrelevant to LocalFrame core functionality, so it can be moved to |
// DragController. |
-std::unique_ptr<DragImage> LocalFrame::DragImageForSelection(float opacity) { |
- if (!Selection().ComputeVisibleSelectionInDOMTreeDeprecated().IsRange()) |
+std::unique_ptr<DragImage> LocalFrame::DragImageForSelection( |
+ const LocalFrame& frame, |
+ float opacity) { |
+ if (!frame.Selection().ComputeVisibleSelectionInDOMTreeDeprecated().IsRange()) |
return nullptr; |
- view_->UpdateAllLifecyclePhasesExceptPaint(); |
- DCHECK(GetDocument()->IsActive()); |
+ frame.View()->UpdateAllLifecyclePhasesExceptPaint(); |
+ DCHECK(frame.GetDocument()->IsActive()); |
- FloatRect painting_rect = FloatRect(Selection().Bounds()); |
+ FloatRect painting_rect = FloatRect(frame.Selection().Bounds()); |
GlobalPaintFlags paint_flags = |
kGlobalPaintSelectionOnly | kGlobalPaintFlattenCompositingLayers; |
- PaintRecordBuilder builder(DeviceSpaceBounds(painting_rect, *this)); |
- view_->PaintContents(builder.Context(), paint_flags, |
- EnclosingIntRect(painting_rect)); |
- return CreateDragImageForFrame(*this, opacity, kDoNotRespectImageOrientation, |
+ PaintRecordBuilder builder(DeviceSpaceBounds(painting_rect, frame)); |
+ frame.View()->PaintContents(builder.Context(), paint_flags, |
+ EnclosingIntRect(painting_rect)); |
+ return CreateDragImageForFrame(frame, opacity, kDoNotRespectImageOrientation, |
painting_rect, builder, |
PropertyTreeState::Root()); |
} |