| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/editing/markers/GenericDocumentMarkerListImpl.h" | 5 #include "core/editing/markers/GenericDocumentMarkerListImpl.h" |
| 6 | 6 |
| 7 #include "core/editing/markers/DocumentMarkerListEditor.h" | 7 #include "core/editing/markers/DocumentMarkerListEditor.h" |
| 8 #include "core/editing/markers/RenderedDocumentMarker.h" | 8 #include "core/editing/markers/RenderedDocumentMarker.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 bool GenericDocumentMarkerListImpl::IsEmpty() const { | 12 bool GenericDocumentMarkerListImpl::IsEmpty() const { |
| 13 return markers_.IsEmpty(); | 13 return markers_.IsEmpty(); |
| 14 } | 14 } |
| 15 | 15 |
| 16 void GenericDocumentMarkerListImpl::Add(DocumentMarker* marker) { | 16 void GenericDocumentMarkerListImpl::Add(DocumentMarker* marker) { |
| 17 switch (marker->GetType()) { | 17 switch (marker->GetType()) { |
| 18 case DocumentMarker::kSpelling: | 18 case DocumentMarker::kSpelling: |
| 19 case DocumentMarker::kGrammar: | 19 case DocumentMarker::kGrammar: |
| 20 DocumentMarkerListEditor::AddMarkerAndMergeOverlapping(&markers_, marker); | 20 DocumentMarkerListEditor::AddMarkerAndMergeOverlapping(&markers_, marker); |
| 21 return; | 21 return; |
| 22 case DocumentMarker::kTextMatch: | 22 case DocumentMarker::kTextMatch: |
| 23 case DocumentMarker::kComposition: | |
| 24 DocumentMarkerListEditor::AddMarkerWithoutMergingOverlapping(&markers_, | 23 DocumentMarkerListEditor::AddMarkerWithoutMergingOverlapping(&markers_, |
| 25 marker); | 24 marker); |
| 26 return; | 25 return; |
| 26 case DocumentMarker::kComposition: |
| 27 NOTREACHED(); |
| 27 } | 28 } |
| 28 | 29 |
| 29 NOTREACHED(); | 30 NOTREACHED(); |
| 30 return; | 31 return; |
| 31 } | 32 } |
| 32 | 33 |
| 33 void GenericDocumentMarkerListImpl::Clear() { | 34 void GenericDocumentMarkerListImpl::Clear() { |
| 34 markers_.clear(); | 35 markers_.clear(); |
| 35 } | 36 } |
| 36 | 37 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 63 return DocumentMarkerListEditor::ShiftMarkers(&markers_, offset, old_length, | 64 return DocumentMarkerListEditor::ShiftMarkers(&markers_, offset, old_length, |
| 64 new_length); | 65 new_length); |
| 65 } | 66 } |
| 66 | 67 |
| 67 DEFINE_TRACE(GenericDocumentMarkerListImpl) { | 68 DEFINE_TRACE(GenericDocumentMarkerListImpl) { |
| 68 visitor->Trace(markers_); | 69 visitor->Trace(markers_); |
| 69 DocumentMarkerList::Trace(visitor); | 70 DocumentMarkerList::Trace(visitor); |
| 70 } | 71 } |
| 71 | 72 |
| 72 } // namespace blink | 73 } // namespace blink |
| OLD | NEW |