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/CompositionMarkerListImpl.h" |
| 6 |
| 7 #include "core/editing/markers/DocumentMarkerListEditor.h" |
| 8 #include "core/editing/markers/RenderedDocumentMarker.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 bool CompositionMarkerListImpl::IsEmpty() const { |
| 13 return markers_.IsEmpty(); |
| 14 } |
| 15 |
| 16 void CompositionMarkerListImpl::Add(DocumentMarker* marker) { |
| 17 DocumentMarkerListEditor::AddMarkerWithoutMergingOverlapping(&markers_, |
| 18 marker); |
| 19 } |
| 20 |
| 21 void CompositionMarkerListImpl::Clear() { |
| 22 markers_.clear(); |
| 23 } |
| 24 |
| 25 const HeapVector<Member<RenderedDocumentMarker>>& |
| 26 CompositionMarkerListImpl::GetMarkers() const { |
| 27 return markers_; |
| 28 } |
| 29 |
| 30 bool CompositionMarkerListImpl::MoveMarkers(int length, |
| 31 DocumentMarkerList* dst_markers_) { |
| 32 return DocumentMarkerListEditor::MoveMarkers(&markers_, length, dst_markers_); |
| 33 } |
| 34 |
| 35 bool CompositionMarkerListImpl::RemoveMarkers(unsigned start_offset, |
| 36 int length) { |
| 37 return DocumentMarkerListEditor::RemoveMarkers(&markers_, start_offset, |
| 38 length); |
| 39 } |
| 40 |
| 41 bool CompositionMarkerListImpl::RemoveMarkersUnderWords( |
| 42 const String& node_text, |
| 43 const Vector<String>& words) { |
| 44 // This method will be removed from the DocumentMarkerList interface once |
| 45 // SpellCheckMatchMarkerListImpl is added. DocumentMarkerController shouldn't |
| 46 // try to call it on a list storing Composition markers. |
| 47 NOTREACHED(); |
| 48 return false; |
| 49 } |
| 50 |
| 51 bool CompositionMarkerListImpl::ShiftMarkers(unsigned offset, |
| 52 unsigned old_length, |
| 53 unsigned new_length) { |
| 54 return DocumentMarkerListEditor::ShiftMarkers(&markers_, offset, old_length, |
| 55 new_length); |
| 56 } |
| 57 |
| 58 DEFINE_TRACE(CompositionMarkerListImpl) { |
| 59 visitor->Trace(markers_); |
| 60 DocumentMarkerList::Trace(visitor); |
| 61 } |
| 62 |
| 63 } // namespace blink |
OLD | NEW |