OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/test_runner/test_runner_for_specific_view.h" | 5 #include "components/test_runner/test_runner_for_specific_view.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <limits> | 8 #include <limits> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 find_options.wordStart = true; | 652 find_options.wordStart = true; |
653 else if (option == "TreatMedialCapitalAsWordStart") | 653 else if (option == "TreatMedialCapitalAsWordStart") |
654 find_options.medialCapitalAsWordStart = true; | 654 find_options.medialCapitalAsWordStart = true; |
655 else if (option == "WrapAround") | 655 else if (option == "WrapAround") |
656 wrap_around = true; | 656 wrap_around = true; |
657 } | 657 } |
658 | 658 |
659 WebLocalFrame* frame = web_view()->mainFrame()->toWebLocalFrame(); | 659 WebLocalFrame* frame = web_view()->mainFrame()->toWebLocalFrame(); |
660 const bool find_result = frame->find(0, WebString::fromUTF8(search_text), | 660 const bool find_result = frame->find(0, WebString::fromUTF8(search_text), |
661 find_options, wrap_around, 0); | 661 find_options, wrap_around, 0); |
662 frame->stopFinding(false); | 662 frame->stopFinding(WebLocalFrame::StopFindActionKeepSelection); |
663 return find_result; | 663 return find_result; |
664 } | 664 } |
665 | 665 |
666 std::string TestRunnerForSpecificView::SelectionAsMarkup() { | 666 std::string TestRunnerForSpecificView::SelectionAsMarkup() { |
667 return web_view()->mainFrame()->selectionAsMarkup().utf8(); | 667 return web_view()->mainFrame()->selectionAsMarkup().utf8(); |
668 } | 668 } |
669 | 669 |
670 void TestRunnerForSpecificView::SetViewSourceForFrame(const std::string& name, | 670 void TestRunnerForSpecificView::SetViewSourceForFrame(const std::string& name, |
671 bool enabled) { | 671 bool enabled) { |
672 WebFrame* target_frame = | 672 WebFrame* target_frame = |
673 web_view()->findFrameByName(WebString::fromUTF8(name)); | 673 web_view()->findFrameByName(WebString::fromUTF8(name)); |
674 if (target_frame) | 674 if (target_frame) |
675 target_frame->enableViewSourceMode(enabled); | 675 target_frame->enableViewSourceMode(enabled); |
676 } | 676 } |
677 | 677 |
678 blink::WebView* TestRunnerForSpecificView::web_view() { | 678 blink::WebView* TestRunnerForSpecificView::web_view() { |
679 return web_test_proxy_base_->web_view(); | 679 return web_test_proxy_base_->web_view(); |
680 } | 680 } |
681 | 681 |
682 WebTestDelegate* TestRunnerForSpecificView::delegate() { | 682 WebTestDelegate* TestRunnerForSpecificView::delegate() { |
683 return web_test_proxy_base_->delegate(); | 683 return web_test_proxy_base_->delegate(); |
684 } | 684 } |
685 | 685 |
686 } // namespace test_runner | 686 } // namespace test_runner |
OLD | NEW |