Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(562)

Unified Diff: third_party/WebKit/Source/core/editing/markers/TextMatchMarkerList.h

Issue 2784753002: Add TextMatchMarkerList in preparation for DocumentMarkerController refactor (Closed)
Patch Set: Remove "explicit" Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..17372d998e132b7ec7840f82540f56857da50e0f
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/markers/TextMatchMarkerList.h
@@ -0,0 +1,50 @@
+// 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 DocumentMarker;
+
+// TextMatchMarkerList only supports adding TextMatch markers in sorted order,
+// and adds some functionality specific to TextMatch markers.
+class CORE_EXPORT TextMatchMarkerList : public DocumentMarkerList {
+ public:
+ TextMatchMarkerList();
+
+ // DocumentMarkerList implementations
+ DocumentMarker::MarkerType allowedMarkerType() const final;
+ TextMatchMarker* at(size_t index) final;
+ void add(DocumentMarker*) final;
+
+ // TextMatchMarkerList-specific methods
+ void appendRenderedRectsToInputList(const Node&,
+ Vector<IntRect>* result) const;
+ void invalidateRects();
+ bool setTextMatchMarkersActive(unsigned startOffset,
+ unsigned endOffset,
+ bool active);
+
+ protected:
+ bool markerListIsSorted() const final;
+
+ DECLARE_VIRTUAL_TRACE();
+ DISALLOW_COPY_AND_ASSIGN(TextMatchMarkerList);
+};
+
+DEFINE_TYPE_CASTS(TextMatchMarkerList,
+ DocumentMarkerList,
+ list,
+ list->allowedMarkerType() == DocumentMarker::TextMatch,
+ list.allowedMarkerType() == DocumentMarker::TextMatch);
+
+} // namespace blink
+
+#endif // TextMatchMarkerList_h

Powered by Google App Engine
This is Rietveld 408576698