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 23 matching lines...) Expand all Loading... |
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/CharacterIterator.h" | 41 #include "core/editing/iterators/CharacterIterator.h" |
42 #include "core/frame/FrameView.h" | 42 #include "core/frame/FrameView.h" |
43 #include "core/layout/LayoutObject.h" | 43 #include "core/layout/LayoutObject.h" |
| 44 #include "core/layout/TextAutosizer.h" |
44 #include "core/page/Page.h" | 45 #include "core/page/Page.h" |
45 #include "modules/accessibility/AXObject.h" | 46 #include "modules/accessibility/AXObject.h" |
46 #include "modules/accessibility/AXObjectCacheImpl.h" | 47 #include "modules/accessibility/AXObjectCacheImpl.h" |
47 #include "platform/Timer.h" | 48 #include "platform/Timer.h" |
48 #include "public/platform/WebVector.h" | 49 #include "public/platform/WebVector.h" |
49 #include "public/web/WebAXObject.h" | 50 #include "public/web/WebAXObject.h" |
50 #include "public/web/WebFindOptions.h" | 51 #include "public/web/WebFindOptions.h" |
51 #include "public/web/WebFrameClient.h" | 52 #include "public/web/WebFrameClient.h" |
52 #include "public/web/WebViewClient.h" | 53 #include "public/web/WebViewClient.h" |
53 #include "web/FindInPageCoordinates.h" | 54 #include "web/FindInPageCoordinates.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 if (!m_activeMatch) { | 149 if (!m_activeMatch) { |
149 // If we're finding next the next active match might not be in the curre
nt frame. | 150 // 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. | 151 // In this case we don't want to clear the matches cache. |
151 if (!options.findNext) | 152 if (!options.findNext) |
152 clearFindMatchesCache(); | 153 clearFindMatchesCache(); |
153 | 154 |
154 ownerFrame().frameView()->invalidatePaintForTickmarks(); | 155 ownerFrame().frameView()->invalidatePaintForTickmarks(); |
155 return false; | 156 return false; |
156 } | 157 } |
157 | 158 |
158 #if OS(ANDROID) | 159 // If the user is browsing a page with autosizing, adjust the zoom to the |
159 ownerFrame().viewImpl()->zoomToFindInPageRect(ownerFrame().frameView()->cont
entsToRootFrame(enclosingIntRect(LayoutObject::absoluteBoundingBoxRectForRange(m
_activeMatch.get())))); | 160 // column where the next hit has been found. Doing this when autosizing is |
160 #endif | 161 // not set will result in a zoom reset on small devices. |
| 162 if (ownerFrame().frame()->document()->textAutosizer()->pageNeedsAutosizing()
) { |
| 163 ownerFrame().viewImpl()->zoomToFindInPageRect(ownerFrame().frameView()->
contentsToRootFrame(enclosingIntRect(LayoutObject::absoluteBoundingBoxRectForRan
ge(m_activeMatch.get())))); |
| 164 } |
161 | 165 |
162 setMarkerActive(m_activeMatch.get(), true); | 166 setMarkerActive(m_activeMatch.get(), true); |
163 WebLocalFrameImpl* oldActiveFrame = mainFrameImpl->ensureTextFinder().m_curr
entActiveMatchFrame; | 167 WebLocalFrameImpl* oldActiveFrame = mainFrameImpl->ensureTextFinder().m_curr
entActiveMatchFrame; |
164 mainFrameImpl->ensureTextFinder().m_currentActiveMatchFrame = &ownerFrame(); | 168 mainFrameImpl->ensureTextFinder().m_currentActiveMatchFrame = &ownerFrame(); |
165 | 169 |
166 // Make sure no node is focused. See http://crbug.com/38700. | 170 // Make sure no node is focused. See http://crbug.com/38700. |
167 ownerFrame().frame()->document()->setFocusedElement(nullptr); | 171 ownerFrame().frame()->document()->setFocusedElement(nullptr); |
168 | 172 |
169 if (!options.findNext || activeSelection) { | 173 if (!options.findNext || activeSelection) { |
170 // This is either a Find operation or a Find-next from a new start point | 174 // This is either a Find operation or a Find-next from a new start point |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 visitor->trace(m_ownerFrame); | 794 visitor->trace(m_ownerFrame); |
791 visitor->trace(m_currentActiveMatchFrame); | 795 visitor->trace(m_currentActiveMatchFrame); |
792 visitor->trace(m_activeMatch); | 796 visitor->trace(m_activeMatch); |
793 visitor->trace(m_resumeScopingFromRange); | 797 visitor->trace(m_resumeScopingFromRange); |
794 visitor->trace(m_deferredScopingWork); | 798 visitor->trace(m_deferredScopingWork); |
795 visitor->trace(m_findMatchesCache); | 799 visitor->trace(m_findMatchesCache); |
796 #endif | 800 #endif |
797 } | 801 } |
798 | 802 |
799 } // namespace blink | 803 } // namespace blink |
OLD | NEW |