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

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

Issue 1605863002: Restart search in page when new text is found. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added default value for local var Created 4 years, 10 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
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 class WebLocalFrameImpl; 49 class WebLocalFrameImpl;
50 50
51 template <typename T> class WebVector; 51 template <typename T> class WebVector;
52 52
53 class TextFinder final : public NoBaseWillBeGarbageCollectedFinalized<TextFinder > { 53 class TextFinder final : public NoBaseWillBeGarbageCollectedFinalized<TextFinder > {
54 public: 54 public:
55 static PassOwnPtrWillBeRawPtr<TextFinder> create(WebLocalFrameImpl& ownerFra me); 55 static PassOwnPtrWillBeRawPtr<TextFinder> create(WebLocalFrameImpl& ownerFra me);
56 56
57 bool find( 57 bool find(
58 int identifier, const WebString& searchText, const WebFindOptions&, 58 int identifier, const WebString& searchText, const WebFindOptions&,
59 bool wrapWithinFrame, WebRect* selectionRect); 59 bool wrapWithinFrame, WebRect* selectionRect, bool* activeNow = nullptr) ;
60 void stopFindingAndClearSelection(); 60 void stopFindingAndClearSelection();
61 void scopeStringMatches( 61 void scopeStringMatches(
62 int identifier, const WebString& searchText, const WebFindOptions&, 62 int identifier, const WebString& searchText, const WebFindOptions&,
63 bool reset); 63 bool reset);
64 void cancelPendingScopingEffort(); 64 void cancelPendingScopingEffort();
65 void increaseMatchCount(int identifier, int count); 65 void increaseMatchCount(int identifier, int count);
66 void resetMatchCount(); 66 void resetMatchCount();
67 int findMatchMarkersVersion() const { return m_findMatchMarkersVersion; } 67 int findMatchMarkersVersion() const { return m_findMatchMarkersVersion; }
68 WebFloatRect activeFindMatchRect(); 68 WebFloatRect activeFindMatchRect();
69 void findMatchRects(WebVector<WebFloatRect>&); 69 void findMatchRects(WebVector<WebFloatRect>&);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 // Rects are automatically invalidated in case of content size changes, 141 // Rects are automatically invalidated in case of content size changes,
142 // propagating the invalidation to child frames. 142 // propagating the invalidation to child frames.
143 void updateFindMatchRects(); 143 void updateFindMatchRects();
144 144
145 // Append the find-in-page match rects of the current frame to the provided vector. 145 // Append the find-in-page match rects of the current frame to the provided vector.
146 void appendFindMatchRects(Vector<WebFloatRect>& frameRects); 146 void appendFindMatchRects(Vector<WebFloatRect>& frameRects);
147 147
148 // Add a WebKit TextMatch-highlight marker to nodes in a range. 148 // Add a WebKit TextMatch-highlight marker to nodes in a range.
149 void addMarker(Range*, bool activeMatch); 149 void addMarker(Range*, bool activeMatch);
150 150
151 // Sets the markers within a range as active or inactive. 151 // Sets the markers within a range as active or inactive. Returns true if at least
152 void setMarkerActive(Range*, bool active); 152 // one such marker found.
153 bool setMarkerActive(Range*, bool active);
153 154
154 // Removes all markers. 155 // Removes all markers.
155 void unmarkAllTextMatches(); 156 void unmarkAllTextMatches();
156 157
157 // Returns the ordinal of the first match in the frame specified. This 158 // Returns the ordinal of the first match in the frame specified. This
158 // function enumerates the frames, starting with the main frame and up to (b ut 159 // function enumerates the frames, starting with the main frame and up to (b ut
159 // not including) the frame passed in as a parameter and counts how many 160 // not including) the frame passed in as a parameter and counts how many
160 // matches have been found. 161 // matches have been found.
161 int ordinalOfFirstMatchForFrame(WebLocalFrameImpl*) const; 162 int ordinalOfFirstMatchForFrame(WebLocalFrameImpl*) const;
162 163
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 // Determines if the rects in the find-in-page matches cache of this frame 279 // Determines if the rects in the find-in-page matches cache of this frame
279 // are invalid and should be recomputed. 280 // are invalid and should be recomputed.
280 bool m_findMatchRectsAreValid; 281 bool m_findMatchRectsAreValid;
281 }; 282 };
282 283
283 } // namespace blink 284 } // namespace blink
284 285
285 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::TextFinder::FindMatch); 286 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::TextFinder::FindMatch);
286 287
287 #endif // TextFinder_h 288 #endif // TextFinder_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698