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

Side by Side Diff: third_party/WebKit/Source/web/TextFinder.cpp

Issue 2801483002: Add DocumentMarker::MatchStatus enum for text match markers (Closed)
Patch Set: Add k prefix 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/testing/Internals.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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 // To stop looking for the active tickmark, we set this flag. 390 // To stop looking for the active tickmark, we set this flag.
391 m_locatingActiveRect = false; 391 m_locatingActiveRect = false;
392 392
393 // Notify browser of new location for the selected rectangle. 393 // Notify browser of new location for the selected rectangle.
394 reportFindInPageSelection( 394 reportFindInPageSelection(
395 ownerFrame().frameView()->contentsToRootFrame(resultBounds), 395 ownerFrame().frameView()->contentsToRootFrame(resultBounds),
396 m_activeMatchIndex + 1, identifier); 396 m_activeMatchIndex + 1, identifier);
397 } 397 }
398 398
399 ownerFrame().frame()->document()->markers().addTextMatchMarker( 399 ownerFrame().frame()->document()->markers().addTextMatchMarker(
400 EphemeralRange(resultRange), foundActiveMatch); 400 EphemeralRange(resultRange),
401 foundActiveMatch ? DocumentMarker::MatchStatus::kActive
402 : DocumentMarker::MatchStatus::kInactive);
401 403
402 m_findMatchesCache.push_back( 404 m_findMatchesCache.push_back(
403 FindMatch(resultRange, m_lastMatchCount + matchCount)); 405 FindMatch(resultRange, m_lastMatchCount + matchCount));
404 406
405 // Set the new start for the search range to be the end of the previous 407 // Set the new start for the search range to be the end of the previous
406 // result range. There is no need to use a VisiblePosition here, 408 // result range. There is no need to use a VisiblePosition here,
407 // since findPlainText will use a TextIterator to go over the visible 409 // since findPlainText will use a TextIterator to go over the visible
408 // text nodes. 410 // text nodes.
409 searchStart = result.endPosition(); 411 searchStart = result.endPosition();
410 412
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 781
780 DEFINE_TRACE(TextFinder) { 782 DEFINE_TRACE(TextFinder) {
781 visitor->trace(m_ownerFrame); 783 visitor->trace(m_ownerFrame);
782 visitor->trace(m_activeMatch); 784 visitor->trace(m_activeMatch);
783 visitor->trace(m_resumeScopingFromRange); 785 visitor->trace(m_resumeScopingFromRange);
784 visitor->trace(m_deferredScopingWork); 786 visitor->trace(m_deferredScopingWork);
785 visitor->trace(m_findMatchesCache); 787 visitor->trace(m_findMatchesCache);
786 } 788 }
787 789
788 } // namespace blink 790 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/testing/Internals.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698