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

Unified Diff: third_party/WebKit/Source/core/editing/markers/ActiveSuggestionMarkerListImpl.cpp

Issue 2923033002: [ActiveSuggestionMarker #2] Add ActiveSuggestionMarker (Closed)
Patch Set: Update comment on ActiveSuggestionMarker.h Created 3 years, 6 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/ActiveSuggestionMarkerListImpl.cpp
diff --git a/third_party/WebKit/Source/core/editing/markers/ActiveSuggestionMarkerListImpl.cpp b/third_party/WebKit/Source/core/editing/markers/ActiveSuggestionMarkerListImpl.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..600eeedca402ca85cf3c059281d0b642600a3989
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/markers/ActiveSuggestionMarkerListImpl.cpp
@@ -0,0 +1,57 @@
+// 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.
+
+#include "core/editing/markers/ActiveSuggestionMarkerListImpl.h"
+
+#include "core/editing/markers/DocumentMarkerListEditor.h"
+
+namespace blink {
+
+DocumentMarker::MarkerType ActiveSuggestionMarkerListImpl::MarkerType() const {
+ return DocumentMarker::kActiveSuggestion;
+}
+
+bool ActiveSuggestionMarkerListImpl::IsEmpty() const {
+ return markers_.IsEmpty();
+}
+
+void ActiveSuggestionMarkerListImpl::Add(DocumentMarker* marker) {
+ DocumentMarkerListEditor::AddMarkerWithoutMergingOverlapping(&markers_,
+ marker);
+}
+
+void ActiveSuggestionMarkerListImpl::Clear() {
+ markers_.clear();
+}
+
+const HeapVector<Member<DocumentMarker>>&
+ActiveSuggestionMarkerListImpl::GetMarkers() const {
+ return markers_;
+}
+
+bool ActiveSuggestionMarkerListImpl::MoveMarkers(
+ int length,
+ DocumentMarkerList* dst_markers_) {
+ return DocumentMarkerListEditor::MoveMarkers(&markers_, length, dst_markers_);
+}
+
+bool ActiveSuggestionMarkerListImpl::RemoveMarkers(unsigned start_offset,
+ int length) {
+ return DocumentMarkerListEditor::RemoveMarkers(&markers_, start_offset,
+ length);
+}
+
+bool ActiveSuggestionMarkerListImpl::ShiftMarkers(unsigned offset,
+ unsigned old_length,
+ unsigned new_length) {
+ return DocumentMarkerListEditor::ShiftMarkersContentIndependent(
+ &markers_, offset, old_length, new_length);
+}
+
+DEFINE_TRACE(ActiveSuggestionMarkerListImpl) {
+ visitor->Trace(markers_);
+ DocumentMarkerList::Trace(visitor);
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698