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

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

Issue 2805553003: DocumentMarkerList refactor as an interface (Closed)
Patch Set: Respond to comments, fill in unimplemented methods Created 3 years, 8 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/CompositionMarkerList.h
diff --git a/third_party/WebKit/Source/core/editing/markers/CompositionMarkerList.h b/third_party/WebKit/Source/core/editing/markers/CompositionMarkerList.h
new file mode 100644
index 0000000000000000000000000000000000000000..575798e9b3dfd82d01cc229b64e3ef228e83c45f
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/markers/CompositionMarkerList.h
@@ -0,0 +1,56 @@
+// 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 CompositionMarkerList_h
+#define CompositionMarkerList_h
+
+#include "core/editing/markers/DocumentMarkerList.h"
+
+namespace blink {
+
+class CORE_EXPORT CompositionMarkerList final : public DocumentMarkerList {
+ public:
+ CompositionMarkerList();
+
+ DocumentMarker::MarkerType allowedMarkerType() const final;
+
+ bool empty() const final;
+ DocumentMarker* 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();
+
+ private:
+ HeapVector<Member<DocumentMarker>> m_markers;
+
+ DISALLOW_COPY_AND_ASSIGN(CompositionMarkerList);
+};
+
+DEFINE_TYPE_CASTS(CompositionMarkerList,
+ DocumentMarkerList,
+ list,
+ list->allowedMarkerType() == DocumentMarker::Composition,
+ list.allowedMarkerType() == DocumentMarker::Composition);
+
+} // namespace blink
+
+#endif // CompositionMarkerList_h

Powered by Google App Engine
This is Rietveld 408576698