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

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

Issue 2780313002: [WIP] Refactor DocumentMarker (Closed)
Patch Set: Move CompositionMarkerList::at() into this CL Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/core/editing/markers/TextMatchMarker.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/TextMatchMarkerList.h" 5 #include "core/editing/markers/TextMatchMarkerList.h"
6 6
7 #include "core/editing/markers/DocumentMarkerController.h" 7 #include "core/editing/markers/DocumentMarkerController.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 textMatchMarker->invalidate(); 44 textMatchMarker->invalidate();
45 } 45 }
46 } 46 }
47 47
48 bool TextMatchMarkerList::setTextMatchMarkersActive(unsigned startOffset, 48 bool TextMatchMarkerList::setTextMatchMarkersActive(unsigned startOffset,
49 unsigned endOffset, 49 unsigned endOffset,
50 bool active) { 50 bool active) {
51 bool docDirty = false; 51 bool docDirty = false;
52 for (auto it = getPosOfFirstMarkerNotEndingBefore(startOffset); 52 for (auto it = getPosOfFirstMarkerNotEndingBefore(startOffset);
53 it != m_markers.end(); ++it) { 53 it != m_markers.end(); ++it) {
54 DocumentMarker& marker = **it; 54 TextMatchMarker& marker = toTextMatchMarker(**it);
55 // Markers are stored in order, so stop if we are now past the specified 55 // Markers are stored in order, so stop if we are now past the specified
56 // range. 56 // range.
57 if (marker.startOffset() >= endOffset) 57 if (marker.startOffset() >= endOffset)
58 break; 58 break;
59 59
60 marker.setActiveMatch(active); 60 marker.setActiveMatch(active);
61 docDirty = true; 61 docDirty = true;
62 } 62 }
63 63
64 return docDirty; 64 return docDirty;
65 } 65 }
66 66
67 bool TextMatchMarkerList::markerListIsSorted() const { 67 bool TextMatchMarkerList::markerListIsSorted() const {
68 return true; 68 return true;
69 } 69 }
70 70
71 DEFINE_TRACE(TextMatchMarkerList) { 71 DEFINE_TRACE(TextMatchMarkerList) {
72 visitor->trace(m_markers); 72 visitor->trace(m_markers);
73 DocumentMarkerList::trace(visitor); 73 DocumentMarkerList::trace(visitor);
74 } 74 }
75 75
76 } // namespace blink 76 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/markers/TextMatchMarker.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698