OLD | NEW |
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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 // To stop looking for the active tickmark, we set this flag. | 353 // To stop looking for the active tickmark, we set this flag. |
354 m_locatingActiveRect = false; | 354 m_locatingActiveRect = false; |
355 | 355 |
356 // Notify browser of new location for the selected rectangle. | 356 // Notify browser of new location for the selected rectangle. |
357 reportFindInPageSelection( | 357 reportFindInPageSelection( |
358 ownerFrame().frameView()->contentsToRootFrame(resultBounds), | 358 ownerFrame().frameView()->contentsToRootFrame(resultBounds), |
359 m_activeMatchIndex + 1, | 359 m_activeMatchIndex + 1, |
360 identifier); | 360 identifier); |
361 } | 361 } |
362 | 362 |
363 addMarker(resultRange, foundActiveMatch); | 363 ownerFrame().frame()->document()->markers().addTextMatchMarker(resultRan
ge, foundActiveMatch); |
364 | 364 |
365 m_findMatchesCache.append(FindMatch(resultRange, m_lastMatchCount + matc
hCount)); | 365 m_findMatchesCache.append(FindMatch(resultRange, m_lastMatchCount + matc
hCount)); |
366 | 366 |
367 // Set the new start for the search range to be the end of the previous | 367 // Set the new start for the search range to be the end of the previous |
368 // result range. There is no need to use a VisiblePosition here, | 368 // result range. There is no need to use a VisiblePosition here, |
369 // since findPlainText will use a TextIterator to go over the visible | 369 // since findPlainText will use a TextIterator to go over the visible |
370 // text nodes. | 370 // text nodes. |
371 searchStart = result.endPosition(); | 371 searchStart = result.endPosition(); |
372 | 372 |
373 m_resumeScopingFromRange = Range::create(result.document(), toPositionIn
DOMTree(result.endPosition()), toPositionInDOMTree(result.endPosition())); | 373 m_resumeScopingFromRange = Range::create(result.document(), toPositionIn
DOMTree(result.endPosition()), toPositionInDOMTree(result.endPosition())); |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 , m_scopingInProgress(false) | 649 , m_scopingInProgress(false) |
650 , m_lastFindRequestCompletedWithNoMatches(false) | 650 , m_lastFindRequestCompletedWithNoMatches(false) |
651 , m_findMatchRectsAreValid(false) | 651 , m_findMatchRectsAreValid(false) |
652 { | 652 { |
653 } | 653 } |
654 | 654 |
655 TextFinder::~TextFinder() | 655 TextFinder::~TextFinder() |
656 { | 656 { |
657 } | 657 } |
658 | 658 |
659 void TextFinder::addMarker(Range* range, bool activeMatch) | |
660 { | |
661 ownerFrame().frame()->document()->markers().addTextMatchMarker(range, active
Match); | |
662 } | |
663 | |
664 bool TextFinder::setMarkerActive(Range* range, bool active) | 659 bool TextFinder::setMarkerActive(Range* range, bool active) |
665 { | 660 { |
666 if (!range || range->collapsed()) | 661 if (!range || range->collapsed()) |
667 return false; | 662 return false; |
668 return ownerFrame().frame()->document()->markers().setMarkersActive(range, a
ctive); | 663 return ownerFrame().frame()->document()->markers().setMarkersActive(range, a
ctive); |
669 } | 664 } |
670 | 665 |
671 void TextFinder::unmarkAllTextMatches() | 666 void TextFinder::unmarkAllTextMatches() |
672 { | 667 { |
673 LocalFrame* frame = ownerFrame().frame(); | 668 LocalFrame* frame = ownerFrame().frame(); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 DEFINE_TRACE(TextFinder) | 737 DEFINE_TRACE(TextFinder) |
743 { | 738 { |
744 visitor->trace(m_ownerFrame); | 739 visitor->trace(m_ownerFrame); |
745 visitor->trace(m_activeMatch); | 740 visitor->trace(m_activeMatch); |
746 visitor->trace(m_resumeScopingFromRange); | 741 visitor->trace(m_resumeScopingFromRange); |
747 visitor->trace(m_deferredScopingWork); | 742 visitor->trace(m_deferredScopingWork); |
748 visitor->trace(m_findMatchesCache); | 743 visitor->trace(m_findMatchesCache); |
749 } | 744 } |
750 | 745 |
751 } // namespace blink | 746 } // namespace blink |
OLD | NEW |