Chromium Code Reviews| 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 c4a778575e1c40c242ebde2ee37bb18e87a6b7ef..7e74d61cb478fde1686788154d18148120c08e66 100644 |
| --- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp |
| +++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp |
| @@ -117,6 +117,9 @@ namespace { |
| // Converts from bounds in CSS space to device space based on the given |
| // frame. |
| +// TODO(tanvir.rizvi): DeviceSpaceBounds is used for drag related functionality |
| +// and is independent of core functionality of LocalFrame. This should be moved |
|
Xiaocheng
2017/06/07 17:29:31
nit: s/independent of/irrelevant to/
The function
tanvir
2017/06/08 06:01:58
Done.
|
| +// out of LocalFrame to appropriate place. |
| static FloatRect DeviceSpaceBounds(const FloatRect css_bounds, |
| const LocalFrame& frame) { |
| float device_scale_factor = frame.GetPage()->DeviceScaleFactorDeprecated(); |
| @@ -131,7 +134,10 @@ static FloatRect DeviceSpaceBounds(const FloatRect css_bounds, |
| // Returns a DragImage whose bitmap contains |contents|, positioned and scaled |
| // in device space. |
| -static std::unique_ptr<DragImage> CreateDragImage( |
| +// TODO(tanvir.rizvi): CreateDragImageForFrame is used for drag related |
| +// functionality and is independent of core functionality of LocalFrame. This |
| +// should be moved out of LocalFrame to appropriate place. |
| +static std::unique_ptr<DragImage> CreateDragImageForFrame( |
| const LocalFrame& frame, |
| float opacity, |
| RespectImageOrientationEnum image_orientation, |
| @@ -168,6 +174,9 @@ static std::unique_ptr<DragImage> CreateDragImage( |
| opacity); |
| } |
| +// TODO(tanvir.rizvi): DraggedNodeImageBuilder is used for drag related |
| +// functionality and is independent of core functionality of LocalFrame. This |
| +// should be moved out of LocalFrame to appropriate place. |
| class DraggedNodeImageBuilder { |
| STACK_ALLOCATED(); |
| @@ -228,7 +237,7 @@ class DraggedNodeImageBuilder { |
| border_box_properties = |
| *layer->GetLayoutObject().LocalBorderBoxProperties(); |
| } |
| - return CreateDragImage( |
| + return CreateDragImageForFrame( |
| *local_frame_, 1.0f, |
| LayoutObject::ShouldRespectImageOrientation(dragged_layout_object), |
| bounding_box, builder, border_box_properties); |
| @@ -749,6 +758,9 @@ double LocalFrame::DevicePixelRatio() const { |
| return ratio; |
| } |
| +// TODO(tanvir.rizvi): NodeImage is used only by DataTransfer, |
| +// and is independent of LocalFrame core functionality, so it can be moved to |
| +// DataTransfer. |
| std::unique_ptr<DragImage> LocalFrame::NodeImage(Node& node) { |
| DraggedNodeImageBuilder image_node(*this, node); |
| return image_node.CreateImage(); |
| @@ -768,8 +780,9 @@ std::unique_ptr<DragImage> LocalFrame::DragImageForSelection(float opacity) { |
| PaintRecordBuilder builder(DeviceSpaceBounds(painting_rect, *this)); |
| view_->PaintContents(builder.Context(), paint_flags, |
| EnclosingIntRect(painting_rect)); |
| - return CreateDragImage(*this, opacity, kDoNotRespectImageOrientation, |
| - painting_rect, builder, PropertyTreeState::Root()); |
| + return CreateDragImageForFrame(*this, opacity, kDoNotRespectImageOrientation, |
| + painting_rect, builder, |
| + PropertyTreeState::Root()); |
| } |
| String LocalFrame::SelectedText() const { |