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

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

Issue 2801483002: Add DocumentMarker::MatchStatus enum for text match markers (Closed)
Patch Set: Update tests Created 3 years, 8 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 14 matching lines...) Expand all
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef TextFinder_h 31 #ifndef TextFinder_h
32 #define TextFinder_h 32 #define TextFinder_h
33 33
34 #include "core/editing/FindOptions.h" 34 #include "core/editing/FindOptions.h"
35 #include "core/editing/markers/DocumentMarker.h"
35 #include "platform/geometry/FloatRect.h" 36 #include "platform/geometry/FloatRect.h"
36 #include "platform/heap/Handle.h" 37 #include "platform/heap/Handle.h"
37 #include "public/platform/WebFloatPoint.h" 38 #include "public/platform/WebFloatPoint.h"
38 #include "public/platform/WebFloatRect.h" 39 #include "public/platform/WebFloatRect.h"
39 #include "public/platform/WebRect.h" 40 #include "public/platform/WebRect.h"
40 #include "public/web/WebFindOptions.h" 41 #include "public/web/WebFindOptions.h"
41 #include "web/WebExport.h" 42 #include "web/WebExport.h"
42 #include "wtf/Noncopyable.h" 43 #include "wtf/Noncopyable.h"
43 #include "wtf/PassRefPtr.h" 44 #include "wtf/PassRefPtr.h"
44 #include "wtf/Vector.h" 45 #include "wtf/Vector.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // the marker in window coordinates if selectionRect is not null. 152 // the marker in window coordinates if selectionRect is not null.
152 int selectFindMatch(unsigned index, WebRect* selectionRect); 153 int selectFindMatch(unsigned index, WebRect* selectionRect);
153 154
154 // Compute and cache the rects for FindMatches if required. 155 // Compute and cache the rects for FindMatches if required.
155 // Rects are automatically invalidated in case of content size changes, 156 // Rects are automatically invalidated in case of content size changes,
156 // propagating the invalidation to child frames. 157 // propagating the invalidation to child frames.
157 void updateFindMatchRects(); 158 void updateFindMatchRects();
158 159
159 // Sets the markers within a range as active or inactive. Returns true if at 160 // Sets the markers within a range as active or inactive. Returns true if at
160 // least one such marker found. 161 // least one such marker found.
161 bool setMarkerActive(Range*, bool active); 162 bool setMarkerActive(Range*, DocumentMarker::MatchStatus);
162 163
163 // Removes all markers. 164 // Removes all markers.
164 void unmarkAllTextMatches(); 165 void unmarkAllTextMatches();
165 166
166 // Determines whether the scoping effort is required for a particular frame. 167 // Determines whether the scoping effort is required for a particular frame.
167 // It is not necessary if the frame is invisible, for example, or if this 168 // It is not necessary if the frame is invisible, for example, or if this
168 // is a repeat search that already returned nothing last time the same prefix 169 // is a repeat search that already returned nothing last time the same prefix
169 // was searched. 170 // was searched.
170 bool shouldScopeMatches(const WTF::String& searchText, const WebFindOptions&); 171 bool shouldScopeMatches(const WTF::String& searchText, const WebFindOptions&);
171 172
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 // Determines if the rects in the find-in-page matches cache of this frame 285 // Determines if the rects in the find-in-page matches cache of this frame
285 // are invalid and should be recomputed. 286 // are invalid and should be recomputed.
286 bool m_findMatchRectsAreValid; 287 bool m_findMatchRectsAreValid;
287 }; 288 };
288 289
289 } // namespace blink 290 } // namespace blink
290 291
291 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::TextFinder::FindMatch); 292 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::TextFinder::FindMatch);
292 293
293 #endif // TextFinder_h 294 #endif // TextFinder_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698