Index: third_party/WebKit/Source/core/editing/markers/TextMatchMarkerList.h |
diff --git a/third_party/WebKit/Source/core/editing/markers/TextMatchMarkerList.h b/third_party/WebKit/Source/core/editing/markers/TextMatchMarkerList.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7013f2863f136261c7176cfcf55addca3a8fe441 |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/editing/markers/TextMatchMarkerList.h |
@@ -0,0 +1,66 @@ |
+// 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 TextMatchMarkerList_h |
+#define TextMatchMarkerList_h |
+ |
+#include "core/editing/markers/DocumentMarkerList.h" |
+ |
+#include "core/editing/markers/TextMatchMarker.h" |
+ |
+namespace blink { |
+ |
+class CORE_EXPORT TextMatchMarkerList final : public DocumentMarkerList { |
+ public: |
+ TextMatchMarkerList(); |
+ |
+ DocumentMarker::MarkerType allowedMarkerType() const final; |
+ |
+ bool empty() const final; |
+ TextMatchMarker* at(size_t index) final; |
+ |
+ void add(DocumentMarker*) final; |
+ void clear() final; |
+ |
+ void appendMarkersToInputList(DocumentMarkerVector* list) const; |
+ |
+ DidCopyMarkerOrNot copyMarkers(unsigned startOffset, |
+ int length, |
+ DocumentMarkerList* dstList, |
+ int delta) final; |
+ |
+ DidRemoveMarkerOrNot removeMarkers( |
+ unsigned startOffset, |
+ int length, |
+ bool shouldRemovePartiallyOverlappingMarkers) final; |
+ |
+ DidShiftMarkerOrNot shiftMarkers(unsigned offset, |
+ unsigned oldLength, |
+ unsigned newLength) final; |
+ |
+ DECLARE_VIRTUAL_TRACE(); |
+ |
+ // TextMatchMarkerList-specific methods |
+ void appendRenderedRectsToInputList(const Node&, |
+ Vector<IntRect>* result) const; |
+ void invalidateRects(); |
+ bool setTextMatchMarkersActive(unsigned startOffset, |
+ unsigned endOffset, |
+ bool active); |
+ |
+ private: |
+ HeapVector<Member<DocumentMarker>> m_markers; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(TextMatchMarkerList); |
+}; |
+ |
+DEFINE_TYPE_CASTS(TextMatchMarkerList, |
+ DocumentMarkerList, |
+ list, |
+ list->allowedMarkerType() == DocumentMarker::TextMatch, |
+ list.allowedMarkerType() == DocumentMarker::TextMatch); |
+ |
+} // namespace blink |
+ |
+#endif // TextMatchMarkerList_h |