| 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 23 matching lines...) Expand all Loading... |
| 34 #include "core/dom/TaskRunnerHelper.h" | 34 #include "core/dom/TaskRunnerHelper.h" |
| 35 #include "core/dom/shadow/ShadowRoot.h" | 35 #include "core/dom/shadow/ShadowRoot.h" |
| 36 #include "core/editing/Editor.h" | 36 #include "core/editing/Editor.h" |
| 37 #include "core/editing/FindInPageCoordinates.h" | 37 #include "core/editing/FindInPageCoordinates.h" |
| 38 #include "core/editing/VisibleSelection.h" | 38 #include "core/editing/VisibleSelection.h" |
| 39 #include "core/editing/iterators/SearchBuffer.h" | 39 #include "core/editing/iterators/SearchBuffer.h" |
| 40 #include "core/editing/markers/DocumentMarker.h" | 40 #include "core/editing/markers/DocumentMarker.h" |
| 41 #include "core/editing/markers/DocumentMarkerController.h" | 41 #include "core/editing/markers/DocumentMarkerController.h" |
| 42 #include "core/exported/WebViewBase.h" | 42 #include "core/exported/WebViewBase.h" |
| 43 #include "core/frame/FrameView.h" | 43 #include "core/frame/FrameView.h" |
| 44 #include "core/frame/WebLocalFrameBase.h" |
| 44 #include "core/layout/LayoutObject.h" | 45 #include "core/layout/LayoutObject.h" |
| 45 #include "core/layout/TextAutosizer.h" | 46 #include "core/layout/TextAutosizer.h" |
| 46 #include "core/page/Page.h" | 47 #include "core/page/Page.h" |
| 47 #include "modules/accessibility/AXObject.h" | 48 #include "modules/accessibility/AXObject.h" |
| 48 #include "modules/accessibility/AXObjectCacheImpl.h" | 49 #include "modules/accessibility/AXObjectCacheImpl.h" |
| 49 #include "platform/RuntimeEnabledFeatures.h" | 50 #include "platform/RuntimeEnabledFeatures.h" |
| 50 #include "platform/Timer.h" | 51 #include "platform/Timer.h" |
| 51 #include "platform/wtf/CurrentTime.h" | 52 #include "platform/wtf/CurrentTime.h" |
| 52 #include "public/platform/WebVector.h" | 53 #include "public/platform/WebVector.h" |
| 53 #include "public/web/WebAXObject.h" | 54 #include "public/web/WebAXObject.h" |
| 54 #include "public/web/WebFindOptions.h" | 55 #include "public/web/WebFindOptions.h" |
| 55 #include "public/web/WebFrameClient.h" | 56 #include "public/web/WebFrameClient.h" |
| 56 #include "public/web/WebViewClient.h" | 57 #include "public/web/WebViewClient.h" |
| 57 #include "web/WebLocalFrameImpl.h" | |
| 58 | 58 |
| 59 namespace blink { | 59 namespace blink { |
| 60 | 60 |
| 61 TextFinder::FindMatch::FindMatch(Range* range, int ordinal) | 61 TextFinder::FindMatch::FindMatch(Range* range, int ordinal) |
| 62 : range_(range), ordinal_(ordinal) {} | 62 : range_(range), ordinal_(ordinal) {} |
| 63 | 63 |
| 64 DEFINE_TRACE(TextFinder::FindMatch) { | 64 DEFINE_TRACE(TextFinder::FindMatch) { |
| 65 visitor->Trace(range_); | 65 visitor->Trace(range_); |
| 66 } | 66 } |
| 67 | 67 |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 } | 556 } |
| 557 | 557 |
| 558 find_matches_cache_.swap(filtered_matches); | 558 find_matches_cache_.swap(filtered_matches); |
| 559 } | 559 } |
| 560 | 560 |
| 561 // Invalidate the rects in child frames. Will be updated later during | 561 // Invalidate the rects in child frames. Will be updated later during |
| 562 // traversal. | 562 // traversal. |
| 563 if (!find_match_rects_are_valid_) | 563 if (!find_match_rects_are_valid_) |
| 564 for (WebFrame* child = OwnerFrame().FirstChild(); child; | 564 for (WebFrame* child = OwnerFrame().FirstChild(); child; |
| 565 child = child->NextSibling()) | 565 child = child->NextSibling()) |
| 566 ToWebLocalFrameImpl(child) | 566 ToWebLocalFrameBase(child) |
| 567 ->EnsureTextFinder() | 567 ->EnsureTextFinder() |
| 568 .find_match_rects_are_valid_ = false; | 568 .find_match_rects_are_valid_ = false; |
| 569 | 569 |
| 570 find_match_rects_are_valid_ = true; | 570 find_match_rects_are_valid_ = true; |
| 571 } | 571 } |
| 572 | 572 |
| 573 WebFloatRect TextFinder::ActiveFindMatchRect() { | 573 WebFloatRect TextFinder::ActiveFindMatchRect() { |
| 574 if (!current_active_match_frame_ || !active_match_) | 574 if (!current_active_match_frame_ || !active_match_) |
| 575 return WebFloatRect(); | 575 return WebFloatRect(); |
| 576 | 576 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 active_match_bounding_box); | 670 active_match_bounding_box); |
| 671 OwnerFrame().ViewImpl()->ZoomToFindInPageRect(active_match_rect); | 671 OwnerFrame().ViewImpl()->ZoomToFindInPageRect(active_match_rect); |
| 672 } | 672 } |
| 673 | 673 |
| 674 if (selection_rect) | 674 if (selection_rect) |
| 675 *selection_rect = active_match_rect; | 675 *selection_rect = active_match_rect; |
| 676 | 676 |
| 677 return active_match_index_ + 1; | 677 return active_match_index_ + 1; |
| 678 } | 678 } |
| 679 | 679 |
| 680 TextFinder* TextFinder::Create(WebLocalFrameImpl& owner_frame) { | 680 TextFinder* TextFinder::Create(WebLocalFrameBase& owner_frame) { |
| 681 return new TextFinder(owner_frame); | 681 return new TextFinder(owner_frame); |
| 682 } | 682 } |
| 683 | 683 |
| 684 TextFinder::TextFinder(WebLocalFrameImpl& owner_frame) | 684 TextFinder::TextFinder(WebLocalFrameBase& owner_frame) |
| 685 : owner_frame_(&owner_frame), | 685 : owner_frame_(&owner_frame), |
| 686 current_active_match_frame_(false), | 686 current_active_match_frame_(false), |
| 687 active_match_index_(-1), | 687 active_match_index_(-1), |
| 688 resume_scoping_from_range_(nullptr), | 688 resume_scoping_from_range_(nullptr), |
| 689 last_match_count_(-1), | 689 last_match_count_(-1), |
| 690 total_match_count_(-1), | 690 total_match_count_(-1), |
| 691 frame_scoping_(false), | 691 frame_scoping_(false), |
| 692 find_request_identifier_(-1), | 692 find_request_identifier_(-1), |
| 693 next_invalidate_after_(0), | 693 next_invalidate_after_(0), |
| 694 find_match_markers_version_(0), | 694 find_match_markers_version_(0), |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 789 | 789 |
| 790 DEFINE_TRACE(TextFinder) { | 790 DEFINE_TRACE(TextFinder) { |
| 791 visitor->Trace(owner_frame_); | 791 visitor->Trace(owner_frame_); |
| 792 visitor->Trace(active_match_); | 792 visitor->Trace(active_match_); |
| 793 visitor->Trace(resume_scoping_from_range_); | 793 visitor->Trace(resume_scoping_from_range_); |
| 794 visitor->Trace(deferred_scoping_work_); | 794 visitor->Trace(deferred_scoping_work_); |
| 795 visitor->Trace(find_matches_cache_); | 795 visitor->Trace(find_matches_cache_); |
| 796 } | 796 } |
| 797 | 797 |
| 798 } // namespace blink | 798 } // namespace blink |
| OLD | NEW |