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

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

Issue 2764783004: Add DocumentMarker::createTextMatchMarker() (Closed)
Patch Set: Rebase Created 3 years, 9 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 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
7 * reserved. 7 * reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 void DocumentMarkerController::addTextMatchMarker(const EphemeralRange& range, 78 void DocumentMarkerController::addTextMatchMarker(const EphemeralRange& range,
79 bool activeMatch) { 79 bool activeMatch) {
80 DCHECK(!m_document->needsLayoutTreeUpdate()); 80 DCHECK(!m_document->needsLayoutTreeUpdate());
81 81
82 // Use a TextIterator to visit the potentially multiple nodes the range 82 // Use a TextIterator to visit the potentially multiple nodes the range
83 // covers. 83 // covers.
84 for (TextIterator markedText(range.startPosition(), range.endPosition()); 84 for (TextIterator markedText(range.startPosition(), range.endPosition());
85 !markedText.atEnd(); markedText.advance()) { 85 !markedText.atEnd(); markedText.advance()) {
86 addMarker(markedText.currentContainer(), 86 addMarker(markedText.currentContainer(),
87 new DocumentMarker(markedText.startOffsetInCurrentContainer(), 87 DocumentMarker::createTextMatchMarker(
88 markedText.endOffsetInCurrentContainer(), 88 markedText.startOffsetInCurrentContainer(),
89 activeMatch)); 89 markedText.endOffsetInCurrentContainer(), activeMatch));
90 } 90 }
91 // Don't invalidate tickmarks here. TextFinder invalidates tickmarks using a 91 // Don't invalidate tickmarks here. TextFinder invalidates tickmarks using a
92 // throttling algorithm. crbug.com/6819. 92 // throttling algorithm. crbug.com/6819.
93 } 93 }
94 94
95 void DocumentMarkerController::addCompositionMarker(const Position& start, 95 void DocumentMarkerController::addCompositionMarker(const Position& start,
96 const Position& end, 96 const Position& end,
97 Color underlineColor, 97 Color underlineColor,
98 bool thick, 98 bool thick,
99 Color backgroundColor) { 99 Color backgroundColor) {
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 } 566 }
567 567
568 } // namespace blink 568 } // namespace blink
569 569
570 #ifndef NDEBUG 570 #ifndef NDEBUG
571 void showDocumentMarkers(const blink::DocumentMarkerController* controller) { 571 void showDocumentMarkers(const blink::DocumentMarkerController* controller) {
572 if (controller) 572 if (controller)
573 controller->showMarkers(); 573 controller->showMarkers();
574 } 574 }
575 #endif 575 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698