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

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

Issue 2904973003: [DMC #15] Add TextMatchMarkerListImpl::SetTextMatchMarkersActive() (Closed)
Patch Set: Rebase 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« 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