Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: third_party/WebKit/Source/core/editing/markers/GenericDocumentMarkerListImpl.cpp

Issue 2842263002: [DMC #3.5] Split up DocumentMarkerListEditor::AddMarker() into two methods (Closed)
Patch Set: Fix accidental renaming, move method implementation to make patch smaller Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 DocumentMarkerListEditor::AddMarker(&markers_, marker); 17 switch (marker->GetType()) {
18 case DocumentMarker::kSpelling:
19 case DocumentMarker::kGrammar:
20 DocumentMarkerListEditor::AddMarkerAndMergeOverlapping(&markers_, marker);
21 return;
22 case DocumentMarker::kTextMatch:
23 case DocumentMarker::kComposition:
24 DocumentMarkerListEditor::AddMarkerWithoutMergingOverlapping(&markers_,
25 marker);
26 return;
27 }
28
29 NOTREACHED();
yosin_UTC9 2017/04/28 01:01:28 Let's print marker->GetType() to add more info to
30 return;
18 } 31 }
19 32
20 void GenericDocumentMarkerListImpl::Clear() { 33 void GenericDocumentMarkerListImpl::Clear() {
21 markers_.clear(); 34 markers_.clear();
22 } 35 }
23 36
24 const HeapVector<Member<RenderedDocumentMarker>>& 37 const HeapVector<Member<RenderedDocumentMarker>>&
25 GenericDocumentMarkerListImpl::GetMarkers() const { 38 GenericDocumentMarkerListImpl::GetMarkers() const {
26 return markers_; 39 return markers_;
27 } 40 }
(...skipping 22 matching lines...) Expand all
50 return DocumentMarkerListEditor::ShiftMarkers(&markers_, offset, old_length, 63 return DocumentMarkerListEditor::ShiftMarkers(&markers_, offset, old_length,
51 new_length); 64 new_length);
52 } 65 }
53 66
54 DEFINE_TRACE(GenericDocumentMarkerListImpl) { 67 DEFINE_TRACE(GenericDocumentMarkerListImpl) {
55 visitor->Trace(markers_); 68 visitor->Trace(markers_);
56 DocumentMarkerList::Trace(visitor); 69 DocumentMarkerList::Trace(visitor);
57 } 70 }
58 71
59 } // namespace blink 72 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698