| Index: third_party/WebKit/Source/core/page/scrolling/ScrollState.h
|
| diff --git a/third_party/WebKit/Source/core/page/scrolling/ScrollState.h b/third_party/WebKit/Source/core/page/scrolling/ScrollState.h
|
| index 78425dd0dc05bce6e2b61a85feee45d10f0df96a..8894bd03e208b4df464b518aca5224fa94593f45 100644
|
| --- a/third_party/WebKit/Source/core/page/scrolling/ScrollState.h
|
| +++ b/third_party/WebKit/Source/core/page/scrolling/ScrollState.h
|
| @@ -9,7 +9,8 @@
|
| #include "bindings/core/v8/ScriptWrappable.h"
|
| #include "core/CoreExport.h"
|
| #include "core/dom/Element.h"
|
| -#include "public/platform/WebScrollStateData.h"
|
| +#include "platform/scroll/ScrollStateData.h"
|
| +#include <deque>
|
|
|
| namespace blink {
|
|
|
| @@ -17,14 +18,15 @@ class CORE_EXPORT ScrollState final : public RefCountedWillBeGarbageCollectedFin
|
| DEFINE_WRAPPERTYPEINFO();
|
|
|
| public:
|
| + // TODO(tdresser) - the web exposed constructor should have fewer parameters.
|
| static PassRefPtrWillBeRawPtr<ScrollState> create(
|
| - double deltaX, double deltaY, double deltaGranularity, double velocityX,
|
| - double velocityY, bool inInertialPhase,
|
| - bool isBeginning = false, bool isEnding = false,
|
| - bool fromUserInput = false, bool shouldPropagate = true,
|
| + double deltaX, double deltaY, int startPositionX, int startPositionY, double velocityX,
|
| + double velocityY, bool isBeginning = false, bool inInertialPhase = false,
|
| + bool isEnding = false, bool shouldPropagate = true, bool fromUserInput = false,
|
| + bool isDirectManipulation = true, double deltaGranularity = 0,
|
| bool deltaConsumedForScrollSequence = false);
|
|
|
| - static PassRefPtrWillBeRawPtr<ScrollState> create(PassOwnPtr<WebScrollStateData>);
|
| + static PassRefPtrWillBeRawPtr<ScrollState> create(PassOwnPtr<ScrollStateData>);
|
|
|
| ~ScrollState()
|
| {
|
| @@ -36,26 +38,31 @@ public:
|
| void consumeDelta(double x, double y, ExceptionState&);
|
| // Pops the first element off of |m_scrollChain| and calls |distributeScroll| on it.
|
| void distributeToScrollChainDescendant();
|
| + int startPositionX() { return m_data->start_position_x; };
|
| + int startPositionY() { return m_data->start_position_y; };
|
| // Positive when scrolling left.
|
| - double deltaX() const { return m_data->deltaX; };
|
| + double deltaX() const { return m_data->delta_x; };
|
| // Positive when scrolling up.
|
| - double deltaY() const { return m_data->deltaY; };
|
| + double deltaY() const { return m_data->delta_y; };
|
| // Indicates the smallest delta the input device can produce. 0 for unquantized inputs.
|
| - double deltaGranularity() const { return m_data->deltaGranularity; };
|
| + double deltaGranularity() const { return m_data->delta_granularity; };
|
| // Positive if moving right.
|
| - double velocityX() const { return m_data->velocityX; };
|
| + double velocityX() const { return m_data->velocity_x; };
|
| // Positive if moving down.
|
| - double velocityY() const { return m_data->velocityY; };
|
| + double velocityY() const { return m_data->velocity_y; };
|
| // True for events dispatched after the users's gesture has finished.
|
| - bool inInertialPhase() const { return m_data->inInertialPhase; };
|
| + bool inInertialPhase() const { return m_data->is_in_inertial_phase; };
|
| // True if this is the first event for this scroll.
|
| - bool isBeginning() const { return m_data->isBeginning; };
|
| + bool isBeginning() const { return m_data->is_beginning; };
|
| // True if this is the last event for this scroll.
|
| - bool isEnding() const { return m_data->isEnding; };
|
| + bool isEnding() const { return m_data->is_ending; };
|
| // True if this scroll is the direct result of user input.
|
| - bool fromUserInput() const { return m_data->fromUserInput; };
|
| + bool fromUserInput() const { return m_data->from_user_input; };
|
| + // True if this scroll is the result of the user interacting directly with
|
| + // the screen, e.g., via touch.
|
| + bool isDirectManipulation() const { return m_data->is_direct_manipulation; }
|
| // True if this scroll is allowed to bubble upwards.
|
| - bool shouldPropagate() const { return m_data->shouldPropagate; };
|
| + bool shouldPropagate() const { return m_data->should_propagate; };
|
|
|
| // Non web exposed methods.
|
| void consumeDeltaNative(double x, double y);
|
| @@ -69,47 +76,28 @@ public:
|
| Element* currentNativeScrollingElement() const;
|
| void setCurrentNativeScrollingElement(Element*);
|
|
|
| - int currentNativeScrollingElementId() const;
|
| void setCurrentNativeScrollingElementById(int elementId);
|
|
|
| bool deltaConsumedForScrollSequence() const
|
| {
|
| - return m_data->deltaConsumedForScrollSequence;
|
| + return m_data->delta_consumed_for_scroll_sequence;
|
| }
|
|
|
| // Scroll begin and end must propagate to all nodes to ensure
|
| // their state is updated.
|
| bool fullyConsumed() const
|
| {
|
| - return !m_data->deltaX && !m_data->deltaY && !m_data->isEnding && !m_data->isBeginning;
|
| + return !m_data->delta_x && !m_data->delta_y && !m_data->is_ending && !m_data->is_beginning;
|
| }
|
|
|
| - // These are only used for CompositorWorker scrolling, and should be gotten
|
| - // rid of eventually.
|
| - void setCausedScroll(bool x, bool y)
|
| - {
|
| - m_data->causedScrollX = x;
|
| - m_data->causedScrollY = y;
|
| - }
|
| -
|
| - bool causedScrollX() const
|
| - {
|
| - return m_data->causedScrollX;
|
| - }
|
| -
|
| - bool causedScrollY() const
|
| - {
|
| - return m_data->causedScrollY;
|
| - }
|
| -
|
| - WebScrollStateData* data() const { return m_data.get(); }
|
| + ScrollStateData* data() const { return m_data.get(); }
|
|
|
| DEFINE_INLINE_TRACE() {}
|
|
|
| private:
|
| ScrollState();
|
| - ScrollState(PassOwnPtr<WebScrollStateData>);
|
| - PassOwnPtr<WebScrollStateData> m_data;
|
| + ScrollState(PassOwnPtr<ScrollStateData>);
|
| + PassOwnPtr<ScrollStateData> m_data;
|
| std::deque<int> m_scrollChain;
|
| };
|
|
|
|
|