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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 2539283002: Remove PlatformGestureEvent in favour of using WebGestureEvent (Closed)
Patch Set: Add missing copyright on new file Created 4 years 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) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@gmail.com> 10 * Christian Biesinger <cbiesinger@gmail.com>
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 #include "core/layout/compositing/PaintLayerCompositor.h" 68 #include "core/layout/compositing/PaintLayerCompositor.h"
69 #include "core/loader/FrameLoaderClient.h" 69 #include "core/loader/FrameLoaderClient.h"
70 #include "core/page/ChromeClient.h" 70 #include "core/page/ChromeClient.h"
71 #include "core/page/FocusController.h" 71 #include "core/page/FocusController.h"
72 #include "core/page/Page.h" 72 #include "core/page/Page.h"
73 #include "core/page/scrolling/RootScrollerController.h" 73 #include "core/page/scrolling/RootScrollerController.h"
74 #include "core/page/scrolling/RootScrollerUtil.h" 74 #include "core/page/scrolling/RootScrollerUtil.h"
75 #include "core/page/scrolling/ScrollingCoordinator.h" 75 #include "core/page/scrolling/ScrollingCoordinator.h"
76 #include "core/page/scrolling/TopDocumentRootScrollerController.h" 76 #include "core/page/scrolling/TopDocumentRootScrollerController.h"
77 #include "core/paint/PaintLayerFragment.h" 77 #include "core/paint/PaintLayerFragment.h"
78 #include "platform/PlatformGestureEvent.h"
79 #include "platform/PlatformMouseEvent.h" 78 #include "platform/PlatformMouseEvent.h"
80 #include "platform/graphics/CompositorMutableProperties.h" 79 #include "platform/graphics/CompositorMutableProperties.h"
81 #include "platform/graphics/GraphicsLayer.h" 80 #include "platform/graphics/GraphicsLayer.h"
82 #include "platform/graphics/paint/DrawingRecorder.h" 81 #include "platform/graphics/paint/DrawingRecorder.h"
83 #include "platform/scroll/ScrollAnimatorBase.h" 82 #include "platform/scroll/ScrollAnimatorBase.h"
84 #include "platform/scroll/ScrollbarTheme.h" 83 #include "platform/scroll/ScrollbarTheme.h"
85 #include "public/platform/Platform.h" 84 #include "public/platform/Platform.h"
86 85
87 namespace blink { 86 namespace blink {
88 87
(...skipping 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1515 // the case? 1514 // the case?
1516 IntSize elementSize = layer()->size(); 1515 IntSize elementSize = layer()->size();
1517 if (box().shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) 1516 if (box().shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
1518 elementSize.setWidth(0); 1517 elementSize.setWidth(0);
1519 IntPoint resizerPoint = IntPoint(elementSize); 1518 IntPoint resizerPoint = IntPoint(elementSize);
1520 IntPoint localPoint = 1519 IntPoint localPoint =
1521 roundedIntPoint(box().absoluteToLocal(absolutePoint, UseTransforms)); 1520 roundedIntPoint(box().absoluteToLocal(absolutePoint, UseTransforms));
1522 return localPoint - resizerPoint; 1521 return localPoint - resizerPoint;
1523 } 1522 }
1524 1523
1525 void PaintLayerScrollableArea::resize(const PlatformEvent& evt, 1524 void PaintLayerScrollableArea::resize(const IntPoint& pos,
1526 const LayoutSize& oldOffset) { 1525 const LayoutSize& oldOffset) {
1527 // FIXME: This should be possible on generated content but is not right now. 1526 // FIXME: This should be possible on generated content but is not right now.
1528 if (!inResizeMode() || !box().canResize() || !box().node()) 1527 if (!inResizeMode() || !box().canResize() || !box().node())
1529 return; 1528 return;
1530 1529
1531 DCHECK(box().node()->isElementNode()); 1530 DCHECK(box().node()->isElementNode());
1532 Element* element = toElement(box().node()); 1531 Element* element = toElement(box().node());
1533 1532
1534 Document& document = element->document(); 1533 Document& document = element->document();
1535 1534
1536 IntPoint pos;
1537 const PlatformGestureEvent* gevt = 0;
1538
1539 switch (evt.type()) {
1540 case PlatformEvent::MouseMoved:
1541 if (!document.frame()->eventHandler().mousePressed())
1542 return;
1543 pos = static_cast<const PlatformMouseEvent*>(&evt)->position();
1544 break;
1545 case PlatformEvent::GestureScrollUpdate:
1546 pos = static_cast<const PlatformGestureEvent*>(&evt)->position();
1547 gevt = static_cast<const PlatformGestureEvent*>(&evt);
1548 pos = gevt->position();
1549 pos.move(gevt->deltaX(), gevt->deltaY());
1550 break;
1551 default:
1552 ASSERT_NOT_REACHED();
1553 }
1554
1555 float zoomFactor = box().style()->effectiveZoom(); 1535 float zoomFactor = box().style()->effectiveZoom();
1556 1536
1557 IntSize newOffset = 1537 IntSize newOffset =
1558 offsetFromResizeCorner(document.view()->rootFrameToContents(pos)); 1538 offsetFromResizeCorner(document.view()->rootFrameToContents(pos));
1559 newOffset.setWidth(newOffset.width() / zoomFactor); 1539 newOffset.setWidth(newOffset.width() / zoomFactor);
1560 newOffset.setHeight(newOffset.height() / zoomFactor); 1540 newOffset.setHeight(newOffset.height() / zoomFactor);
1561 1541
1562 LayoutSize currentSize = box().size(); 1542 LayoutSize currentSize = box().size();
1563 currentSize.scale(1 / zoomFactor); 1543 currentSize.scale(1 / zoomFactor);
1564 LayoutSize minimumSize = 1544 LayoutSize minimumSize =
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
2034 2014
2035 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: 2015 void PaintLayerScrollableArea::DelayScrollOffsetClampScope::
2036 clampScrollableAreas() { 2016 clampScrollableAreas() {
2037 for (auto& scrollableArea : *s_needsClamp) 2017 for (auto& scrollableArea : *s_needsClamp)
2038 scrollableArea->clampScrollOffsetAfterOverflowChange(); 2018 scrollableArea->clampScrollOffsetAfterOverflowChange();
2039 delete s_needsClamp; 2019 delete s_needsClamp;
2040 s_needsClamp = nullptr; 2020 s_needsClamp = nullptr;
2041 } 2021 }
2042 2022
2043 } // namespace blink 2023 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h ('k') | third_party/WebKit/Source/platform/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698