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

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

Issue 2904973003: [DMC #15] Add TextMatchMarkerListImpl::SetTextMatchMarkersActive() (Closed)
Patch Set: Rebase Created 3 years, 6 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/TextMatchMarkerListImpl.h ('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/TextMatchMarkerListImpl.h" 5 #include "core/editing/markers/TextMatchMarkerListImpl.h"
6 6
7 #include "core/dom/Node.h" 7 #include "core/dom/Node.h"
8 #include "core/dom/Range.h" 8 #include "core/dom/Range.h"
9 #include "core/editing/EphemeralRange.h" 9 #include "core/editing/EphemeralRange.h"
10 #include "core/editing/markers/DocumentMarkerListEditor.h" 10 #include "core/editing/markers/DocumentMarkerListEditor.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 if (!rendered_marker->IsValid()) 74 if (!rendered_marker->IsValid())
75 UpdateMarkerRenderedRect(node, *rendered_marker); 75 UpdateMarkerRenderedRect(node, *rendered_marker);
76 if (!rendered_marker->IsRendered()) 76 if (!rendered_marker->IsRendered())
77 continue; 77 continue;
78 result.push_back(rendered_marker->RenderedRect()); 78 result.push_back(rendered_marker->RenderedRect());
79 } 79 }
80 80
81 return result; 81 return result;
82 } 82 }
83 83
84 bool TextMatchMarkerListImpl::SetTextMatchMarkersActive(unsigned start_offset,
85 unsigned end_offset,
86 bool active) {
87 bool doc_dirty = false;
88
yosin_UTC9 2017/05/26 02:08:33 Please remove an extra blank line.
89 const auto start = std::upper_bound(
90 markers_.begin(), markers_.end(), start_offset,
91 [](size_t start_offset, const Member<DocumentMarker>& marker) {
92 return start_offset < marker->EndOffset();
93 });
94 for (auto it = start; it != markers_.end(); ++it) {
95 DocumentMarker& marker = **it;
96 // Markers are returned in order, so stop if we are now past the specified
97 // range.
98 if (marker.StartOffset() >= end_offset)
99 break;
100
yosin_UTC9 2017/05/26 02:08:33 Please remove an extra blank line.
101 marker.SetIsActiveMatch(active);
102 doc_dirty = true;
103 }
104
yosin_UTC9 2017/05/26 02:08:32 Please remove an extra blank line.
105 return doc_dirty;
106 }
107
84 } // namespace blink 108 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/markers/TextMatchMarkerListImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698