Commit ad2cd261 authored by Christopher Cameron's avatar Christopher Cameron

Rename ScrollElasticityController variables to Chromium style

No functional changes.

BUG=133097
NOTRY=True
TBR=aelias@chromium.org

Review URL: https://codereview.chromium.org/703753003

Cr-Commit-Position: refs/heads/master@{#302766}
parent 250e8dcb
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_RENDERER_INPUT_INPUT_SCROLL_ELASTICITY_CONTROLLER_H_
#define CONTENT_RENDERER_INPUT_INPUT_SCROLL_ELASTICITY_CONTROLLER_H_
/* /*
* Copyright (C) 2011 Apple Inc. All rights reserved. * Copyright (C) 2011 Apple Inc. All rights reserved.
* *
...@@ -23,50 +30,36 @@ ...@@ -23,50 +30,36 @@
* THE POSSIBILITY OF SUCH DAMAGE. * THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef ScrollElasticityController_h namespace content {
#define ScrollElasticityController_h
#if USE(RUBBER_BANDING)
// #include "platform/PlatformExport.h"
// #include "platform/geometry/FloatPoint.h"
// #include "platform/geometry/FloatSize.h"
// #include "platform/scroll/ScrollTypes.h"
// #include "wtf/Noncopyable.h"
namespace blink {
class PlatformWheelEvent;
class ScrollElasticityControllerClient { class ScrollElasticityControllerClient {
protected: protected:
virtual ~ScrollElasticityControllerClient() { } virtual ~ScrollElasticityControllerClient() { }
public: public:
virtual bool allowsHorizontalStretching() = 0; virtual bool AllowsHorizontalStretching() = 0;
virtual bool allowsVerticalStretching() = 0; virtual bool AllowsVerticalStretching() = 0;
// The amount that the view is stretched past the normal allowable bounds. // The amount that the view is stretched past the normal allowable bounds.
// The "overhang" amount. // The "overhang" amount.
virtual IntSize stretchAmount() = 0; virtual IntSize StretchAmount() = 0;
virtual bool pinnedInDirection(const FloatSize&) = 0; virtual bool PinnedInDirection(const FloatSize&) = 0;
virtual bool canScrollHorizontally() = 0; virtual bool CanScrollHorizontally() = 0;
virtual bool canScrollVertically() = 0; virtual bool CanScrollVertically() = 0;
// Return the absolute scroll position, not relative to the scroll origin. // Return the absolute scroll position, not relative to the scroll origin.
virtual blink::IntPoint absoluteScrollPosition() = 0; virtual blink::IntPoint AbsoluteScrollPosition() = 0;
virtual void immediateScrollBy(const FloatSize&) = 0; virtual void ImmediateScrollBy(const FloatSize&) = 0;
virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&) = 0; virtual void ImmediateScrollByWithoutContentEdgeConstraints(const FloatSize&) = 0;
virtual void startSnapRubberbandTimer() = 0; virtual void StartSnapRubberbandTimer() = 0;
virtual void stopSnapRubberbandTimer() = 0; virtual void StopSnapRubberbandTimer() = 0;
// If the current scroll position is within the overhang area, this function will cause // If the current scroll position is within the overhang area, this function will cause
// the page to scroll to the nearest boundary point. // the page to scroll to the nearest boundary point.
virtual void adjustScrollPositionToBoundsIfNecessary() = 0; virtual void AdjustScrollPositionToBoundsIfNecessary() = 0;
}; };
class PLATFORM_EXPORT ScrollElasticityController { class ScrollElasticityController {
WTF_MAKE_NONCOPYABLE(ScrollElasticityController);
public: public:
explicit ScrollElasticityController(ScrollElasticityControllerClient*); explicit ScrollElasticityController(ScrollElasticityControllerClient*);
...@@ -83,14 +76,14 @@ public: ...@@ -83,14 +76,14 @@ public:
// Cocoa does not correctly pass all the gestureBegin/End events. The state // Cocoa does not correctly pass all the gestureBegin/End events. The state
// of this class is guaranteed to become eventually consistent, once the // of this class is guaranteed to become eventually consistent, once the
// user stops using multiple input devices. // user stops using multiple input devices.
bool handleWheelEvent(const PlatformWheelEvent&); bool HandleWheelEvent(const PlatformWheelEvent&);
void snapRubberBandTimerFired(); void SnapRubberbandTimerFired();
bool isRubberBandInProgress() const; bool IsRubberbandInProgress() const;
private: private:
void stopSnapRubberbandTimer(); void StopSnapRubberbandTimer();
void snapRubberBand(); void SnapRubberband();
// This method determines whether a given event should be handled. The // This method determines whether a given event should be handled. The
// logic for control events of gestures (PhaseBegan, PhaseEnded) is handled // logic for control events of gestures (PhaseBegan, PhaseEnded) is handled
...@@ -106,36 +99,34 @@ private: ...@@ -106,36 +99,34 @@ private:
// of the event. // of the event.
bool shouldHandleEvent(const PlatformWheelEvent&); bool shouldHandleEvent(const PlatformWheelEvent&);
ScrollElasticityControllerClient* m_client; ScrollElasticityControllerClient* client_;
// There is an active scroll gesture event. This parameter only gets set to // There is an active scroll gesture event. This parameter only gets set to
// false after the rubber band has been snapped, and before a new gesture // false after the rubber band has been snapped, and before a new gesture
// has begun. A careful audit of the code may deprecate the need for this // has begun. A careful audit of the code may deprecate the need for this
// parameter. // parameter.
bool m_inScrollGesture; bool in_scroll_gesture_;
// At least one event in the current gesture has been consumed and has // At least one event in the current gesture has been consumed and has
// caused the view to scroll or rubber band. All future events in this // caused the view to scroll or rubber band. All future events in this
// gesture will be consumed and overscrolls will cause rubberbanding. // gesture will be consumed and overscrolls will cause rubberbanding.
bool m_hasScrolled; bool has_scrolled_;
bool m_momentumScrollInProgress; bool momentum_scroll_in_progress_;
bool m_ignoreMomentumScrolls; bool ignore_momentum_scrolls_;
CFTimeInterval m_lastMomentumScrollTimestamp; CFTimeInterval last_momentum_scroll_timestamp_;
FloatSize m_overflowScrollDelta; FloatSize overflow_scroll_delta_;
FloatSize m_stretchScrollForce; FloatSize stretch_scroll_force_;
FloatSize m_momentumVelocity; FloatSize momentum_velocity_;
// Rubber band state. // Rubber band state.
CFTimeInterval m_startTime; CFTimeInterval start_time_;
FloatSize m_startStretch; FloatSize start_stretch_;
FloatPoint m_origOrigin; FloatPoint orig_origin_;
FloatSize m_origVelocity; FloatSize orig_velocity_;
bool m_snapRubberbandTimerIsActive; bool snap_rubberband_timer_is_active_;
}; };
} // namespace blink } // namespace content
#endif // USE(RUBBER_BANDING)
#endif // ScrollElasticityController_h #endif // CONTENT_RENDERER_INPUT_INPUT_SCROLL_ELASTICITY_CONTROLLER_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment