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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
9 * rights reserved. 9 * rights reserved.
10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 return 0; 755 return 0;
756 756
757 double ratio = page_->DeviceScaleFactorDeprecated(); 757 double ratio = page_->DeviceScaleFactorDeprecated();
758 ratio *= PageZoomFactor(); 758 ratio *= PageZoomFactor();
759 return ratio; 759 return ratio;
760 } 760 }
761 761
762 // TODO(tanvir.rizvi): NodeImage is used only by DataTransfer, 762 // TODO(tanvir.rizvi): NodeImage is used only by DataTransfer,
763 // and is irrelevant to LocalFrame core functionality, so it can be moved to 763 // and is irrelevant to LocalFrame core functionality, so it can be moved to
764 // DataTransfer. 764 // DataTransfer.
765 std::unique_ptr<DragImage> LocalFrame::NodeImage(Node& node) { 765 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
766 DraggedNodeImageBuilder image_node(*this, node); 766 Node& node) {
767 DraggedNodeImageBuilder image_node(frame, node);
767 return image_node.CreateImage(); 768 return image_node.CreateImage();
768 } 769 }
769 770
770 // TODO(tanvir.rizvi): DragImageForSelection is used only by DragController, 771 // TODO(tanvir.rizvi): DragImageForSelection is used only by DragController,
771 // and is irrelevant to LocalFrame core functionality, so it can be moved to 772 // and is irrelevant to LocalFrame core functionality, so it can be moved to
772 // DragController. 773 // DragController.
773 std::unique_ptr<DragImage> LocalFrame::DragImageForSelection(float opacity) { 774 std::unique_ptr<DragImage> LocalFrame::DragImageForSelection(
774 if (!Selection().ComputeVisibleSelectionInDOMTreeDeprecated().IsRange()) 775 const LocalFrame& frame,
776 float opacity) {
777 if (!frame.Selection().ComputeVisibleSelectionInDOMTreeDeprecated().IsRange())
775 return nullptr; 778 return nullptr;
776 779
777 view_->UpdateAllLifecyclePhasesExceptPaint(); 780 frame.View()->UpdateAllLifecyclePhasesExceptPaint();
778 DCHECK(GetDocument()->IsActive()); 781 DCHECK(frame.GetDocument()->IsActive());
779 782
780 FloatRect painting_rect = FloatRect(Selection().Bounds()); 783 FloatRect painting_rect = FloatRect(frame.Selection().Bounds());
781 GlobalPaintFlags paint_flags = 784 GlobalPaintFlags paint_flags =
782 kGlobalPaintSelectionOnly | kGlobalPaintFlattenCompositingLayers; 785 kGlobalPaintSelectionOnly | kGlobalPaintFlattenCompositingLayers;
783 786
784 PaintRecordBuilder builder(DeviceSpaceBounds(painting_rect, *this)); 787 PaintRecordBuilder builder(DeviceSpaceBounds(painting_rect, frame));
785 view_->PaintContents(builder.Context(), paint_flags, 788 frame.View()->PaintContents(builder.Context(), paint_flags,
786 EnclosingIntRect(painting_rect)); 789 EnclosingIntRect(painting_rect));
787 return CreateDragImageForFrame(*this, opacity, kDoNotRespectImageOrientation, 790 return CreateDragImageForFrame(frame, opacity, kDoNotRespectImageOrientation,
788 painting_rect, builder, 791 painting_rect, builder,
789 PropertyTreeState::Root()); 792 PropertyTreeState::Root());
790 } 793 }
791 794
792 String LocalFrame::SelectedText() const { 795 String LocalFrame::SelectedText() const {
793 return Selection().SelectedText(); 796 return Selection().SelectedText();
794 } 797 }
795 798
796 String LocalFrame::SelectedTextForClipboard() const { 799 String LocalFrame::SelectedTextForClipboard() const {
797 if (!GetDocument()) 800 if (!GetDocument())
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 void LocalFrame::SetViewportIntersectionFromParent( 1237 void LocalFrame::SetViewportIntersectionFromParent(
1235 const IntRect& viewport_intersection) { 1238 const IntRect& viewport_intersection) {
1236 if (remote_viewport_intersection_ != viewport_intersection) { 1239 if (remote_viewport_intersection_ != viewport_intersection) {
1237 remote_viewport_intersection_ = viewport_intersection; 1240 remote_viewport_intersection_ = viewport_intersection;
1238 if (View()) 1241 if (View())
1239 View()->ScheduleAnimation(); 1242 View()->ScheduleAnimation();
1240 } 1243 }
1241 } 1244 }
1242 1245
1243 } // namespace blink 1246 } // namespace blink
OLDNEW
« 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