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

Unified Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 2934233002: In-place modification of drag related functionality present in LocalFrame (Closed)
Patch Set: Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
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());
}
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrame.h ('k') | third_party/WebKit/Source/core/frame/LocalFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698