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

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

Issue 2818873002: [DMC #1.9] Move DocumentMarkerListEditor to its own .h/.cpp files (Closed)
Patch Set: Rebase (EndsBefore is a lambda now) 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/DocumentMarkerListEditor.h
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.h b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.h
new file mode 100644
index 0000000000000000000000000000000000000000..f41907cee207badda861c235886f4f8515d25bcf
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.h
@@ -0,0 +1,41 @@
+// 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 DocumentMarkerListEditor_h
+#define DocumentMarkerListEditor_h
+
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class DocumentMarker;
+class RenderedDocumentMarker;
+
+class DocumentMarkerListEditor {
+ public:
+ using MarkerList = HeapVector<Member<RenderedDocumentMarker>>;
+
+ static void AddMarker(MarkerList*, const DocumentMarker*);
+
+ // Returns true if a marker was moved, false otherwise.
+ static bool MoveMarkers(MarkerList* src_list,
+ int length,
+ MarkerList* dst_list);
+
+ // Returns true if a marker was removed, false otherwise.
+ static bool RemoveMarkers(MarkerList*, unsigned start_offset, int length);
+
+ // Returns true if a marker was shifted or removed, false otherwise.
+ static bool ShiftMarkers(MarkerList*,
+ unsigned offset,
+ unsigned old_length,
+ unsigned new_length);
+
+ private:
+ static void MergeOverlapping(MarkerList*, RenderedDocumentMarker* to_insert);
+};
+
+} // namespace blink
+
+#endif // DocumentMarkerListEditor_h

Powered by Google App Engine
This is Rietveld 408576698