| 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 22 matching lines...) Expand all Loading... |
| 33 #include "web/TextFinder.h" | 33 #include "web/TextFinder.h" |
| 34 | 34 |
| 35 #include "core/dom/DocumentMarker.h" | 35 #include "core/dom/DocumentMarker.h" |
| 36 #include "core/dom/DocumentMarkerController.h" | 36 #include "core/dom/DocumentMarkerController.h" |
| 37 #include "core/dom/Range.h" | 37 #include "core/dom/Range.h" |
| 38 #include "core/dom/shadow/ShadowRoot.h" | 38 #include "core/dom/shadow/ShadowRoot.h" |
| 39 #include "core/editing/Editor.h" | 39 #include "core/editing/Editor.h" |
| 40 #include "core/editing/VisibleSelection.h" | 40 #include "core/editing/VisibleSelection.h" |
| 41 #include "core/editing/iterators/TextIterator.h" | 41 #include "core/editing/iterators/TextIterator.h" |
| 42 #include "core/frame/FrameView.h" | 42 #include "core/frame/FrameView.h" |
| 43 #include "core/layout/LayoutObject.h" |
| 43 #include "core/page/Page.h" | 44 #include "core/page/Page.h" |
| 44 #include "core/rendering/RenderObject.h" | |
| 45 #include "modules/accessibility/AXObject.h" | 45 #include "modules/accessibility/AXObject.h" |
| 46 #include "modules/accessibility/AXObjectCacheImpl.h" | 46 #include "modules/accessibility/AXObjectCacheImpl.h" |
| 47 #include "platform/Timer.h" | 47 #include "platform/Timer.h" |
| 48 #include "public/platform/WebVector.h" | 48 #include "public/platform/WebVector.h" |
| 49 #include "public/web/WebAXObject.h" | 49 #include "public/web/WebAXObject.h" |
| 50 #include "public/web/WebFindOptions.h" | 50 #include "public/web/WebFindOptions.h" |
| 51 #include "public/web/WebFrameClient.h" | 51 #include "public/web/WebFrameClient.h" |
| 52 #include "public/web/WebViewClient.h" | 52 #include "public/web/WebViewClient.h" |
| 53 #include "web/FindInPageCoordinates.h" | 53 #include "web/FindInPageCoordinates.h" |
| 54 #include "web/WebLocalFrameImpl.h" | 54 #include "web/WebLocalFrameImpl.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // If we're finding next the next active match might not be in the curre
nt frame. | 149 // If we're finding next the next active match might not be in the curre
nt frame. |
| 150 // In this case we don't want to clear the matches cache. | 150 // In this case we don't want to clear the matches cache. |
| 151 if (!options.findNext) | 151 if (!options.findNext) |
| 152 clearFindMatchesCache(); | 152 clearFindMatchesCache(); |
| 153 | 153 |
| 154 ownerFrame().invalidateAll(); | 154 ownerFrame().invalidateAll(); |
| 155 return false; | 155 return false; |
| 156 } | 156 } |
| 157 | 157 |
| 158 #if OS(ANDROID) | 158 #if OS(ANDROID) |
| 159 ownerFrame().viewImpl()->zoomToFindInPageRect(ownerFrame().frameView()->cont
entsToWindow(enclosingIntRect(RenderObject::absoluteBoundingBoxRectForRange(m_ac
tiveMatch.get())))); | 159 ownerFrame().viewImpl()->zoomToFindInPageRect(ownerFrame().frameView()->cont
entsToWindow(enclosingIntRect(LayoutObject::absoluteBoundingBoxRectForRange(m_ac
tiveMatch.get())))); |
| 160 #endif | 160 #endif |
| 161 | 161 |
| 162 setMarkerActive(m_activeMatch.get(), true); | 162 setMarkerActive(m_activeMatch.get(), true); |
| 163 WebLocalFrameImpl* oldActiveFrame = mainFrameImpl->ensureTextFinder().m_curr
entActiveMatchFrame; | 163 WebLocalFrameImpl* oldActiveFrame = mainFrameImpl->ensureTextFinder().m_curr
entActiveMatchFrame; |
| 164 mainFrameImpl->ensureTextFinder().m_currentActiveMatchFrame = &ownerFrame(); | 164 mainFrameImpl->ensureTextFinder().m_currentActiveMatchFrame = &ownerFrame(); |
| 165 | 165 |
| 166 // Make sure no node is focused. See http://crbug.com/38700. | 166 // Make sure no node is focused. See http://crbug.com/38700. |
| 167 ownerFrame().frame()->document()->setFocusedElement(nullptr); | 167 ownerFrame().frame()->document()->setFocusedElement(nullptr); |
| 168 | 168 |
| 169 if (!options.findNext || activeSelection) { | 169 if (!options.findNext || activeSelection) { |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 setMarkerActive(m_activeMatch.get(), true); | 614 setMarkerActive(m_activeMatch.get(), true); |
| 615 | 615 |
| 616 // Clear any user selection, to make sure Find Next continues on from th
e match we just activated. | 616 // Clear any user selection, to make sure Find Next continues on from th
e match we just activated. |
| 617 ownerFrame().frame()->selection().clear(); | 617 ownerFrame().frame()->selection().clear(); |
| 618 | 618 |
| 619 // Make sure no node is focused. See http://crbug.com/38700. | 619 // Make sure no node is focused. See http://crbug.com/38700. |
| 620 ownerFrame().frame()->document()->setFocusedElement(nullptr); | 620 ownerFrame().frame()->document()->setFocusedElement(nullptr); |
| 621 } | 621 } |
| 622 | 622 |
| 623 IntRect activeMatchRect; | 623 IntRect activeMatchRect; |
| 624 IntRect activeMatchBoundingBox = enclosingIntRect(RenderObject::absoluteBoun
dingBoxRectForRange(m_activeMatch.get())); | 624 IntRect activeMatchBoundingBox = enclosingIntRect(LayoutObject::absoluteBoun
dingBoxRectForRange(m_activeMatch.get())); |
| 625 | 625 |
| 626 if (!activeMatchBoundingBox.isEmpty()) { | 626 if (!activeMatchBoundingBox.isEmpty()) { |
| 627 if (m_activeMatch->firstNode() && m_activeMatch->firstNode()->renderer()
) { | 627 if (m_activeMatch->firstNode() && m_activeMatch->firstNode()->renderer()
) { |
| 628 m_activeMatch->firstNode()->renderer()->scrollRectToVisible( | 628 m_activeMatch->firstNode()->renderer()->scrollRectToVisible( |
| 629 activeMatchBoundingBox, ScrollAlignment::alignCenterIfNeeded, Sc
rollAlignment::alignCenterIfNeeded); | 629 activeMatchBoundingBox, ScrollAlignment::alignCenterIfNeeded, Sc
rollAlignment::alignCenterIfNeeded); |
| 630 } | 630 } |
| 631 | 631 |
| 632 // Zoom to the active match. | 632 // Zoom to the active match. |
| 633 activeMatchRect = ownerFrame().frameView()->contentsToWindow(activeMatch
BoundingBox); | 633 activeMatchRect = ownerFrame().frameView()->contentsToWindow(activeMatch
BoundingBox); |
| 634 ownerFrame().viewImpl()->zoomToFindInPageRect(activeMatchRect); | 634 ownerFrame().viewImpl()->zoomToFindInPageRect(activeMatchRect); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 { | 790 { |
| 791 visitor->trace(m_ownerFrame); | 791 visitor->trace(m_ownerFrame); |
| 792 visitor->trace(m_currentActiveMatchFrame); | 792 visitor->trace(m_currentActiveMatchFrame); |
| 793 visitor->trace(m_activeMatch); | 793 visitor->trace(m_activeMatch); |
| 794 visitor->trace(m_resumeScopingFromRange); | 794 visitor->trace(m_resumeScopingFromRange); |
| 795 visitor->trace(m_deferredScopingWork); | 795 visitor->trace(m_deferredScopingWork); |
| 796 visitor->trace(m_findMatchesCache); | 796 visitor->trace(m_findMatchesCache); |
| 797 } | 797 } |
| 798 | 798 |
| 799 } // namespace blink | 799 } // namespace blink |
| OLD | NEW |