Chromium Code Reviews| Index: third_party/WebKit/Source/core/page/scrolling/RootViewportScrollCallback.h |
| diff --git a/third_party/WebKit/Source/core/page/scrolling/RootViewportScrollCallback.h b/third_party/WebKit/Source/core/page/scrolling/RootViewportScrollCallback.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bec80023ec38a0ca3c03b17b49a0cc2f3e0ae2c7 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/page/scrolling/RootViewportScrollCallback.h |
| @@ -0,0 +1,55 @@ |
| +// Copyright 2016 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 RootViewportScrollCallback_h |
| +#define RootViewportScrollCallback_h |
| + |
| +#include "core/page/scrolling/ViewportScrollCallback.h" |
| +#include "platform/heap/Handle.h" |
| +#include "platform/scroll/ScrollTypes.h" |
| + |
| +namespace blink { |
| + |
| +class FloatSize; |
| +class Element; |
|
tdresser
2016/07/06 18:28:19
Unused.
bokan
2016/07/06 21:12:04
Done.
|
| +class ScrollableArea; |
| +class ScrollState; |
| +class TopControls; |
| +class OverscrollController; |
| + |
| +// The ViewportScrollCallback used by the one root frame on the page. This |
| +// callback provides scrolling of the frame as well as associated actions like |
| +// top controls movement and overscroll glow. |
| +class RootViewportScrollCallback : public ViewportScrollCallback { |
| +public: |
| + // The TopControls and OverscrollController are given to the |
| + // RootViewportScrollCallback but are not owned or kept alive by it. |
| + static RootViewportScrollCallback* create( |
| + TopControls* topControls, OverscrollController* overscrollController) |
| + { |
| + return new RootViewportScrollCallback(topControls, overscrollController); |
| + } |
| + |
| + virtual ~RootViewportScrollCallback(); |
| + |
| + void handleEvent(ScrollState*) override; |
| + void setScroller(ScrollableArea*) override; |
| + |
| + DECLARE_VIRTUAL_TRACE(); |
| + |
| +private: |
| + // RootViewportScrollCallback does not assume ownership of TopControls or of |
| + // OverscrollController. |
| + RootViewportScrollCallback(TopControls*, OverscrollController*); |
| + |
| + bool shouldScrollTopControls(const FloatSize&, ScrollGranularity) const; |
| + |
| + WeakMember<TopControls> m_topControls; |
| + WeakMember<OverscrollController> m_overscrollController; |
| + WeakMember<ScrollableArea> m_scroller; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // RootViewportScrollCallback_h |