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

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: Rebase 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);
esprehn 2016/02/10 01:17:08 = nullptr and then don't change the tons of calls
dvadym 2016/02/10 16:06:21 Done.
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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 // propagating the invalidation to child frames. 150 // propagating the invalidation to child frames.
151 void updateFindMatchRects(); 151 void updateFindMatchRects();
152 152
153 // Append the find-in-page match rects of the current frame to the provided vector. 153 // Append the find-in-page match rects of the current frame to the provided vector.
154 void appendFindMatchRects(Vector<WebFloatRect>& frameRects); 154 void appendFindMatchRects(Vector<WebFloatRect>& frameRects);
155 155
156 // Add a WebKit TextMatch-highlight marker to nodes in a range. 156 // Add a WebKit TextMatch-highlight marker to nodes in a range.
157 void addMarker(Range*, bool activeMatch); 157 void addMarker(Range*, bool activeMatch);
158 158
159 // Sets the markers within a range as active or inactive. 159 // Sets the markers within a range as active or inactive.
160 void setMarkerActive(Range*, bool active); 160 bool setMarkerActive(Range*, bool active);
esprehn 2016/02/10 01:17:08 what does the return mean?
dvadym 2016/02/10 16:06:21 I've added a comment: Returns true if at least one
161 161
162 // Removes all markers. 162 // Removes all markers.
163 void unmarkAllTextMatches(); 163 void unmarkAllTextMatches();
164 164
165 // Returns the ordinal of the first match in the frame specified. This 165 // Returns the ordinal of the first match in the frame specified. This
166 // function enumerates the frames, starting with the main frame and up to (b ut 166 // function enumerates the frames, starting with the main frame and up to (b ut
167 // not including) the frame passed in as a parameter and counts how many 167 // not including) the frame passed in as a parameter and counts how many
168 // matches have been found. 168 // matches have been found.
169 int ordinalOfFirstMatchForFrame(WebLocalFrameImpl*) const; 169 int ordinalOfFirstMatchForFrame(WebLocalFrameImpl*) const;
170 170
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 // Determines if the rects in the find-in-page matches cache of this frame 286 // Determines if the rects in the find-in-page matches cache of this frame
287 // are invalid and should be recomputed. 287 // are invalid and should be recomputed.
288 bool m_findMatchRectsAreValid; 288 bool m_findMatchRectsAreValid;
289 }; 289 };
290 290
291 } // namespace blink 291 } // namespace blink
292 292
293 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::TextFinder::FindMatch); 293 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::TextFinder::FindMatch);
294 294
295 #endif // TextFinder_h 295 #endif // TextFinder_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698