OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "core/editing/markers/CompositionMarkerList.h" |
| 6 |
| 7 #include "core/editing/markers/DocumentMarkerListEditor.h" |
| 8 |
| 9 namespace blink { |
| 10 |
| 11 CompositionMarkerList::CompositionMarkerList() : DocumentMarkerList() {} |
| 12 |
| 13 DocumentMarker::MarkerType CompositionMarkerList::allowedMarkerType() const { |
| 14 return DocumentMarker::Composition; |
| 15 } |
| 16 |
| 17 bool CompositionMarkerList::empty() const { |
| 18 return m_markers.isEmpty(); |
| 19 } |
| 20 |
| 21 DocumentMarker* CompositionMarkerList::at(size_t index) { |
| 22 return m_markers[index].get(); |
| 23 } |
| 24 |
| 25 void CompositionMarkerList::add(DocumentMarker* marker) { |
| 26 m_markers.push_back(marker); |
| 27 } |
| 28 |
| 29 void CompositionMarkerList::clear() { |
| 30 m_markers.clear(); |
| 31 } |
| 32 |
| 33 void CompositionMarkerList::appendMarkersToInputList( |
| 34 DocumentMarkerVector* list) const { |
| 35 DocumentMarkerListEditor::appendMarkersToInputList(m_markers, list); |
| 36 } |
| 37 |
| 38 DocumentMarkerList::DidCopyMarkerOrNot CompositionMarkerList::copyMarkers( |
| 39 unsigned startOffset, |
| 40 int length, |
| 41 DocumentMarkerList* dstList, |
| 42 int delta) { |
| 43 return DocumentMarkerListEditor::copyUnsortedMarkers(&m_markers, startOffset, |
| 44 length, dstList, delta); |
| 45 } |
| 46 |
| 47 DocumentMarkerList::DidRemoveMarkerOrNot CompositionMarkerList::removeMarkers( |
| 48 unsigned startOffset, |
| 49 int length, |
| 50 bool shouldRemovePartiallyOverlappingMarkers) { |
| 51 return DocumentMarkerListEditor::removeUnsortedMarkers( |
| 52 &m_markers, startOffset, length, shouldRemovePartiallyOverlappingMarkers); |
| 53 } |
| 54 |
| 55 DocumentMarkerList::DidShiftMarkerOrNot CompositionMarkerList::shiftMarkers( |
| 56 unsigned offset, |
| 57 unsigned oldLength, |
| 58 unsigned newLength) { |
| 59 return DocumentMarkerListEditor::shiftUnsortedMarkers(&m_markers, offset, |
| 60 oldLength, newLength); |
| 61 } |
| 62 |
| 63 DEFINE_TRACE(CompositionMarkerList) { |
| 64 visitor->trace(m_markers); |
| 65 DocumentMarkerList::trace(visitor); |
| 66 } |
| 67 |
| 68 } // namespace blink |
OLD | NEW |