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::GetAllowedMarkerType() const { |
| 14 return DocumentMarker::kComposition; |
| 15 } |
| 16 |
| 17 bool CompositionMarkerList::Empty() const { |
| 18 return markers_.IsEmpty(); |
| 19 } |
| 20 |
| 21 DocumentMarker* CompositionMarkerList::At(size_t index) { |
| 22 return markers_[index].Get(); |
| 23 } |
| 24 |
| 25 void CompositionMarkerList::Add(DocumentMarker* marker) { |
| 26 markers_.push_back(marker); |
| 27 } |
| 28 |
| 29 void CompositionMarkerList::Clear() { |
| 30 markers_.Clear(); |
| 31 } |
| 32 |
| 33 void CompositionMarkerList::AppendMarkersToInputList( |
| 34 DocumentMarkerVector* list) const { |
| 35 list->AppendVector(markers_); |
| 36 } |
| 37 |
| 38 DocumentMarkerList::DidMoveMarkerOrNot CompositionMarkerList::MoveMarkers( |
| 39 int length, |
| 40 DocumentMarkerList* dst_list) { |
| 41 return DocumentMarkerListEditor::MoveUnsortedMarkers(&markers_, length, |
| 42 dst_list); |
| 43 } |
| 44 |
| 45 DocumentMarkerList::DidRemoveMarkerOrNot CompositionMarkerList::RemoveMarkers( |
| 46 unsigned start_offset, |
| 47 int length) { |
| 48 return DocumentMarkerListEditor::RemoveUnsortedMarkers(&markers_, |
| 49 start_offset, length); |
| 50 } |
| 51 |
| 52 DocumentMarkerList::DidShiftMarkerOrNot CompositionMarkerList::ShiftMarkers( |
| 53 unsigned offset, |
| 54 unsigned old_length, |
| 55 unsigned new_length) { |
| 56 return DocumentMarkerListEditor::ShiftUnsortedMarkers(&markers_, offset, |
| 57 old_length, new_length); |
| 58 } |
| 59 |
| 60 DEFINE_TRACE(CompositionMarkerList) { |
| 61 visitor->Trace(markers_); |
| 62 DocumentMarkerList::Trace(visitor); |
| 63 } |
| 64 |
| 65 } // namespace blink |
OLD | NEW |