Chromium Code Reviews| Index: third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.h |
| diff --git a/third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.h b/third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..21f8f793d60fae74b997e3d15186aea40eb73d5b |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/page/scrolling/SnapCoordinator.h |
| @@ -0,0 +1,48 @@ |
| +// 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 SnapCoordinator_h |
| +#define SnapCoordinator_h |
| + |
| +#include "core/layout/LayoutBox.h" |
| +#include "platform/heap/Handle.h" |
| +#include "wtf/Vector.h" |
| + |
| +namespace blink { |
| + |
| +class ComputedStyle; |
| +class Element; |
| +struct LengthPoint; |
| + |
| +// Snap Coordinator keeps track of snap containers and all of their associated |
|
skobes
2016/03/07 03:42:27
This comment should either describe what snap cont
majidvp
2016/05/03 17:23:36
Done.
|
| +// snap elements. It also contains the logic to generate the final list of snap |
| +// offsets for any snap container. |
| +class CORE_EXPORT SnapCoordinator final : public NoBaseWillBeGarbageCollectedFinalized<SnapCoordinator> { |
| + WTF_MAKE_NONCOPYABLE(SnapCoordinator); |
| + |
| +public: |
| + static PassOwnPtrWillBeRawPtr<SnapCoordinator> create(); |
| + ~SnapCoordinator(); |
| + DEFINE_INLINE_TRACE() {} |
| + |
| + void snapContainerDidChange(LayoutBox&, ScrollSnapType); |
| + void snapAreaDidChange(LayoutBox&, const Vector<LengthPoint>& snapCoordinates); |
| + |
| +#ifndef NDEBUG |
| + void showSnapAreaMap(); |
| + void showSnapAreasFor(const LayoutBox*); |
| +#endif |
| + |
| +private: |
| + friend class SnapCoordinatorTest; |
| + explicit SnapCoordinator(); |
| + |
| + Vector<double> snapOffsets(const Element&, ScrollbarOrientation); |
| + |
| + HashSet<const LayoutBox*> m_snapContainers; |
|
skobes
2016/03/07 03:42:27
Why do we need this exactly? Is it just for showS
majidvp
2016/05/03 17:23:36
Here is the rseponse I gave to esprehn@ on this is
|
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // SnapCoordinator_h |