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/DocumentMarkerListUtils.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::isCompositionMarkerList() const { |
| 18 return true; |
| 19 } |
| 20 |
| 21 size_t CompositionMarkerList::size() const { |
| 22 return m_markers.size(); |
| 23 } |
| 24 |
| 25 bool CompositionMarkerList::empty() const { |
| 26 return m_markers.isEmpty(); |
| 27 } |
| 28 |
| 29 DocumentMarker* CompositionMarkerList::at(size_t index) { |
| 30 return m_markers[index].get(); |
| 31 } |
| 32 |
| 33 void CompositionMarkerList::add(DocumentMarker* marker) { |
| 34 m_markers.push_back(marker); |
| 35 } |
| 36 |
| 37 void CompositionMarkerList::clear() { |
| 38 m_markers.clear(); |
| 39 } |
| 40 |
| 41 CompositionMarkerList::iterator CompositionMarkerList::begin() { |
| 42 return m_markers.begin(); |
| 43 } |
| 44 |
| 45 CompositionMarkerList::iterator CompositionMarkerList::end() { |
| 46 return m_markers.end(); |
| 47 } |
| 48 |
| 49 CompositionMarkerList::const_iterator CompositionMarkerList::begin() const { |
| 50 return m_markers.begin(); |
| 51 } |
| 52 |
| 53 CompositionMarkerList::const_iterator CompositionMarkerList::end() const { |
| 54 return m_markers.end(); |
| 55 } |
| 56 |
| 57 void CompositionMarkerList::appendMarkersToInputList( |
| 58 DocumentMarkerVector* list) const { |
| 59 DocumentMarkerListUtils::appendMarkersToInputList(&m_markers, list); |
| 60 } |
| 61 |
| 62 DocumentMarkerList::DidCopyMarkerOrNot CompositionMarkerList::copyMarkers( |
| 63 unsigned startOffset, |
| 64 int length, |
| 65 DocumentMarkerList* dstList, |
| 66 int delta) { |
| 67 return DocumentMarkerListUtils::copyUnsortedMarkers(&m_markers, startOffset, |
| 68 length, dstList, delta); |
| 69 } |
| 70 |
| 71 DocumentMarkerList::DidRemoveMarkerOrNot CompositionMarkerList::removeMarkers( |
| 72 unsigned startOffset, |
| 73 int length, |
| 74 bool shouldRemovePartiallyOverlappingMarkers) { |
| 75 return DocumentMarkerListUtils::removeUnsortedMarkers( |
| 76 &m_markers, startOffset, length, shouldRemovePartiallyOverlappingMarkers); |
| 77 } |
| 78 |
| 79 DocumentMarkerList::DidShiftMarkerOrNot CompositionMarkerList::shiftMarkers( |
| 80 unsigned offset, |
| 81 unsigned oldLength, |
| 82 unsigned newLength) { |
| 83 return DocumentMarkerListUtils::shiftUnsortedMarkers(&m_markers, offset, |
| 84 oldLength, newLength); |
| 85 } |
| 86 |
| 87 DEFINE_TRACE(CompositionMarkerList) { |
| 88 visitor->trace(m_markers); |
| 89 DocumentMarkerList::trace(visitor); |
| 90 } |
| 91 |
| 92 } // namespace blink |
OLD | NEW |