| 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 29 matching lines...) Expand all Loading... |
| 40 #include "platform/wtf/text/WTFString.h" | 40 #include "platform/wtf/text/WTFString.h" |
| 41 #include "public/platform/WebFloatPoint.h" | 41 #include "public/platform/WebFloatPoint.h" |
| 42 #include "public/platform/WebFloatRect.h" | 42 #include "public/platform/WebFloatRect.h" |
| 43 #include "public/platform/WebRect.h" | 43 #include "public/platform/WebRect.h" |
| 44 #include "public/web/WebFindOptions.h" | 44 #include "public/web/WebFindOptions.h" |
| 45 #include "web/WebExport.h" | 45 #include "web/WebExport.h" |
| 46 | 46 |
| 47 namespace blink { | 47 namespace blink { |
| 48 | 48 |
| 49 class Range; | 49 class Range; |
| 50 class WebLocalFrameImpl; | 50 class WebLocalFrameBase; |
| 51 | 51 |
| 52 template <typename T> | 52 template <typename T> |
| 53 class WebVector; | 53 class WebVector; |
| 54 | 54 |
| 55 class WEB_EXPORT TextFinder final | 55 class WEB_EXPORT TextFinder final |
| 56 : public GarbageCollectedFinalized<TextFinder> { | 56 : public GarbageCollectedFinalized<TextFinder> { |
| 57 WTF_MAKE_NONCOPYABLE(TextFinder); | 57 WTF_MAKE_NONCOPYABLE(TextFinder); |
| 58 | 58 |
| 59 public: | 59 public: |
| 60 static TextFinder* Create(WebLocalFrameImpl& owner_frame); | 60 static TextFinder* Create(WebLocalFrameBase& owner_frame); |
| 61 | 61 |
| 62 bool Find(int identifier, | 62 bool Find(int identifier, |
| 63 const WebString& search_text, | 63 const WebString& search_text, |
| 64 const WebFindOptions&, | 64 const WebFindOptions&, |
| 65 bool wrap_within_frame, | 65 bool wrap_within_frame, |
| 66 bool* active_now = nullptr); | 66 bool* active_now = nullptr); |
| 67 void ClearActiveFindMatch(); | 67 void ClearActiveFindMatch(); |
| 68 void StopFindingAndClearSelection(); | 68 void StopFindingAndClearSelection(); |
| 69 void IncreaseMatchCount(int identifier, int count); | 69 void IncreaseMatchCount(int identifier, int count); |
| 70 int FindMatchMarkersVersion() const { return find_match_markers_version_; } | 70 int FindMatchMarkersVersion() const { return find_match_markers_version_; } |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // Lazily calculated by updateFindMatchRects. | 125 // Lazily calculated by updateFindMatchRects. |
| 126 FloatRect rect_; | 126 FloatRect rect_; |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 DECLARE_TRACE(); | 129 DECLARE_TRACE(); |
| 130 | 130 |
| 131 private: | 131 private: |
| 132 class DeferredScopeStringMatches; | 132 class DeferredScopeStringMatches; |
| 133 friend class DeferredScopeStringMatches; | 133 friend class DeferredScopeStringMatches; |
| 134 | 134 |
| 135 explicit TextFinder(WebLocalFrameImpl& owner_frame); | 135 explicit TextFinder(WebLocalFrameBase& owner_frame); |
| 136 | 136 |
| 137 // Notifies the delegate about a new selection rect. | 137 // Notifies the delegate about a new selection rect. |
| 138 void ReportFindInPageSelection(const WebRect& selection_rect, | 138 void ReportFindInPageSelection(const WebRect& selection_rect, |
| 139 int active_match_ordinal, | 139 int active_match_ordinal, |
| 140 int identifier); | 140 int identifier); |
| 141 | 141 |
| 142 void ReportFindInPageResultToAccessibility(int identifier); | 142 void ReportFindInPageResultToAccessibility(int identifier); |
| 143 | 143 |
| 144 // Clear the find-in-page matches cache forcing rects to be fully | 144 // Clear the find-in-page matches cache forcing rects to be fully |
| 145 // calculated again next time updateFindMatchRects is called. | 145 // calculated again next time updateFindMatchRects is called. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 const WebFindOptions&); | 198 const WebFindOptions&); |
| 199 | 199 |
| 200 // Called by a DeferredScopeStringMatches instance. | 200 // Called by a DeferredScopeStringMatches instance. |
| 201 void ResumeScopingStringMatches(int identifier, | 201 void ResumeScopingStringMatches(int identifier, |
| 202 const WebString& search_text, | 202 const WebString& search_text, |
| 203 const WebFindOptions&); | 203 const WebFindOptions&); |
| 204 | 204 |
| 205 // Determines whether to invalidate the content area and scrollbar. | 205 // Determines whether to invalidate the content area and scrollbar. |
| 206 void InvalidateIfNecessary(); | 206 void InvalidateIfNecessary(); |
| 207 | 207 |
| 208 WebLocalFrameImpl& OwnerFrame() const { | 208 WebLocalFrameBase& OwnerFrame() const { |
| 209 DCHECK(owner_frame_); | 209 DCHECK(owner_frame_); |
| 210 return *owner_frame_; | 210 return *owner_frame_; |
| 211 } | 211 } |
| 212 | 212 |
| 213 Member<WebLocalFrameImpl> owner_frame_; | 213 Member<WebLocalFrameBase> owner_frame_; |
| 214 | 214 |
| 215 // Indicates whether this frame currently has the active match. | 215 // Indicates whether this frame currently has the active match. |
| 216 bool current_active_match_frame_; | 216 bool current_active_match_frame_; |
| 217 | 217 |
| 218 // The range of the active match for the current frame. | 218 // The range of the active match for the current frame. |
| 219 Member<Range> active_match_; | 219 Member<Range> active_match_; |
| 220 | 220 |
| 221 // The index of the active match for the current frame. | 221 // The index of the active match for the current frame. |
| 222 int active_match_index_; | 222 int active_match_index_; |
| 223 | 223 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 // 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 |
| 286 // are invalid and should be recomputed. | 286 // are invalid and should be recomputed. |
| 287 bool find_match_rects_are_valid_; | 287 bool find_match_rects_are_valid_; |
| 288 }; | 288 }; |
| 289 | 289 |
| 290 } // namespace blink | 290 } // namespace blink |
| 291 | 291 |
| 292 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::TextFinder::FindMatch); | 292 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::TextFinder::FindMatch); |
| 293 | 293 |
| 294 #endif // TextFinder_h | 294 #endif // TextFinder_h |
| OLD | NEW |