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

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

Issue 2723663002: Refactor DocumentMarkerController (Closed)
Patch Set: Fix bugs in didUpdateCharacterData 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..95b1c74a38545224129071706693432fe1dc11c1
--- /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/RenderedTextMatchMarker.h"
+#include "core/editing/markers/TextMatchMarker.h"
+
+namespace blink {
+
+class DocumentMarker;
+class TextMatchMarker;
+
+class TextMatchMarkerList : public DocumentMarkerList {
+ WTF_MAKE_NONCOPYABLE(TextMatchMarkerList);
+
+ public:
+ explicit TextMatchMarkerList(DocumentMarkerController*);
+
+ // DocumentMarkerList implementations
+ DocumentMarker::MarkerType allowedMarkerType() const final;
+
+ size_t size() const final;
+ bool empty() const final;
+ RenderedTextMatchMarker* at(size_t index) override;
+
+ void clear() final;
+
+ iterator begin() override;
+ iterator end() override;
+ const_iterator begin() const override;
+ const_iterator end() const override;
+
+ void appendMarkersToInputList(DocumentMarkerVector* list) const final;
+ bool copyMarkers(unsigned startOffset,
+ int length,
+ Node* dstNode,
+ int delta) const;
+ void removeMarkers(unsigned startOffset,
+ int length,
+ bool shouldRemovePartiallyOverlappingMarkers,
+ bool* didRemoveMarker) final;
+ bool shiftMarkers(unsigned startOffset,
+ unsigned oldLength,
+ unsigned newLength) final;
+
+ // TextMatchMarkerList-specific methods
+ void push_back(TextMatchMarker*);
+
+ bool setTextMatchMarkersActive(unsigned startOffset,
+ unsigned endOffset,
+ bool active);
+
+ DECLARE_VIRTUAL_TRACE();
+
+ private:
+ HeapVector<Member<DocumentMarker>> m_markers;
+};
+
+} // namespace blink
+
+#endif // TextMatchMarkerList_h

Powered by Google App Engine
This is Rietveld 408576698