| Index: third_party/WebKit/public/platform/WebSnapPointList.h
|
| diff --git a/third_party/WebKit/public/platform/WebSnapPointList.h b/third_party/WebKit/public/platform/WebSnapPointList.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..b68b2aa7f508a3917214371e4c3248dd1fdd1fc6
|
| --- /dev/null
|
| +++ b/third_party/WebKit/public/platform/WebSnapPointList.h
|
| @@ -0,0 +1,51 @@
|
| +// Copyright 2017 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 WebSnapPointList_h
|
| +#define WebSnapPointList_h
|
| +
|
| +#include <vector>
|
| +#include "WebCommon.h"
|
| +
|
| +namespace blink {
|
| +enum SnapOrientation { kSnapX, kSnapY };
|
| +
|
| +struct WebSnapPoint {
|
| + double offset;
|
| + bool must_snap;
|
| + bool is_start;
|
| + bool is_end;
|
| + WebSnapPoint(double o, bool m, bool start, bool end)
|
| + : offset(o), must_snap(m), is_start(start), is_end(end) {}
|
| + WebSnapPoint(const WebSnapPoint& p)
|
| + : offset(p.offset),
|
| + must_snap(p.must_snap),
|
| + is_start(p.is_start),
|
| + is_end(p.is_end) {}
|
| + bool operator<(const WebSnapPoint& b) const { return offset < b.offset; }
|
| +};
|
| +
|
| +struct WebSnapPointList {
|
| + public:
|
| + WebSnapPointList(){};
|
| + BLINK_PLATFORM_EXPORT void AddSnapPoint(double,
|
| + bool,
|
| + bool,
|
| + bool,
|
| + SnapOrientation);
|
| + BLINK_PLATFORM_EXPORT void Sort();
|
| +
|
| + const std::vector<WebSnapPoint>& HorizontalOffsets() const {
|
| + return horizontal_;
|
| + }
|
| + const std::vector<WebSnapPoint>& VerticalOffsets() const { return vertical_; }
|
| +
|
| + private:
|
| + std::vector<WebSnapPoint> horizontal_;
|
| + std::vector<WebSnapPoint> vertical_;
|
| +};
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif // WebSnapPointList_h
|
|
|