Chromium Code Reviews| Index: third_party/WebKit/Source/web/TextFinder.cpp |
| diff --git a/third_party/WebKit/Source/web/TextFinder.cpp b/third_party/WebKit/Source/web/TextFinder.cpp |
| index 08f7445144404f3d27d76fed3fad099c62d4ac05..f528e8fd1c7267786b9c627caef1a0b6d4d55582 100644 |
| --- a/third_party/WebKit/Source/web/TextFinder.cpp |
| +++ b/third_party/WebKit/Source/web/TextFinder.cpp |
| @@ -112,7 +112,7 @@ private: |
| const bool m_reset; |
| }; |
| -bool TextFinder::find(int identifier, const WebString& searchText, const WebFindOptions& options, bool wrapWithinFrame, WebRect* selectionRect) |
| +bool TextFinder::find(int identifier, const WebString& searchText, const WebFindOptions& options, bool wrapWithinFrame, WebRect* selectionRect, bool& newTextFound) |
| { |
| if (!ownerFrame().frame() || !ownerFrame().frame()->page()) |
| return false; |
| @@ -163,14 +163,14 @@ bool TextFinder::find(int identifier, const WebString& searchText, const WebFind |
| ownerFrame().viewImpl()->zoomToFindInPageRect(ownerFrame().frameView()->contentsToRootFrame(enclosingIntRect(LayoutObject::absoluteBoundingBoxRectForRange(m_activeMatch.get())))); |
| } |
| - setMarkerActive(m_activeMatch.get(), true); |
| + newTextFound = !setMarkerActive(m_activeMatch.get(), true); |
| WebLocalFrameImpl* oldActiveFrame = mainFrameImpl->ensureTextFinder().m_currentActiveMatchFrame; |
| mainFrameImpl->ensureTextFinder().m_currentActiveMatchFrame = &ownerFrame(); |
| // Make sure no node is focused. See http://crbug.com/38700. |
| ownerFrame().frame()->document()->clearFocusedElement(); |
| - if (!options.findNext || activeSelection) { |
| + if (!options.findNext || activeSelection || newTextFound) { |
| // This is either a Find operation or a Find-next from a new start point |
| // due to a selection, so we set the flag to ask the scoping effort |
| // to find the active rect for us and report it back to the UI. |
|
Finnur
2016/01/20 14:14:03
Nit: This comment would now need updating too.
dvadym
2016/01/29 09:44:17
Done.
|
| @@ -687,11 +687,11 @@ void TextFinder::addMarker(Range* range, bool activeMatch) |
| ownerFrame().frame()->document()->markers().addTextMatchMarker(range, activeMatch); |
| } |
| -void TextFinder::setMarkerActive(Range* range, bool active) |
| +bool TextFinder::setMarkerActive(Range* range, bool active) |
| { |
| if (!range || range->collapsed()) |
| - return; |
| - ownerFrame().frame()->document()->markers().setMarkersActive(range, active); |
| + return true; |
|
Finnur
2016/01/20 14:14:03
Wait... why not return false?
dvadym
2016/01/29 09:44:17
Done.
|
| + return ownerFrame().frame()->document()->markers().setMarkersActive(range, active); |
| } |
| void TextFinder::unmarkAllTextMatches() |