Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/markers/TextMatchMarkerListImpl.cpp |
| diff --git a/third_party/WebKit/Source/core/editing/markers/TextMatchMarkerListImpl.cpp b/third_party/WebKit/Source/core/editing/markers/TextMatchMarkerListImpl.cpp |
| index da557e5d802c6b4a0b7d718026f969affc797916..4450946dca0f8f0f83767bdc3c514ecc18ab206c 100644 |
| --- a/third_party/WebKit/Source/core/editing/markers/TextMatchMarkerListImpl.cpp |
| +++ b/third_party/WebKit/Source/core/editing/markers/TextMatchMarkerListImpl.cpp |
| @@ -81,4 +81,28 @@ Vector<IntRect> TextMatchMarkerListImpl::RenderedRects(const Node& node) const { |
| return result; |
| } |
| +bool TextMatchMarkerListImpl::SetTextMatchMarkersActive(unsigned start_offset, |
| + unsigned end_offset, |
| + bool active) { |
| + bool doc_dirty = false; |
| + |
|
yosin_UTC9
2017/05/26 02:08:33
Please remove an extra blank line.
|
| + const auto start = std::upper_bound( |
| + markers_.begin(), markers_.end(), start_offset, |
| + [](size_t start_offset, const Member<DocumentMarker>& marker) { |
| + return start_offset < marker->EndOffset(); |
| + }); |
| + for (auto it = start; it != markers_.end(); ++it) { |
| + DocumentMarker& marker = **it; |
| + // Markers are returned in order, so stop if we are now past the specified |
| + // range. |
| + if (marker.StartOffset() >= end_offset) |
| + break; |
| + |
|
yosin_UTC9
2017/05/26 02:08:33
Please remove an extra blank line.
|
| + marker.SetIsActiveMatch(active); |
| + doc_dirty = true; |
| + } |
| + |
|
yosin_UTC9
2017/05/26 02:08:32
Please remove an extra blank line.
|
| + return doc_dirty; |
| +} |
| + |
| } // namespace blink |