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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 find_options.wordStart = true; | 646 find_options.wordStart = true; |
647 else if (option == "TreatMedialCapitalAsWordStart") | 647 else if (option == "TreatMedialCapitalAsWordStart") |
648 find_options.medialCapitalAsWordStart = true; | 648 find_options.medialCapitalAsWordStart = true; |
649 else if (option == "WrapAround") | 649 else if (option == "WrapAround") |
650 wrap_around = true; | 650 wrap_around = true; |
651 } | 651 } |
652 | 652 |
653 WebLocalFrame* frame = web_view()->mainFrame()->toWebLocalFrame(); | 653 WebLocalFrame* frame = web_view()->mainFrame()->toWebLocalFrame(); |
654 const bool find_result = frame->find(0, WebString::fromUTF8(search_text), | 654 const bool find_result = frame->find(0, WebString::fromUTF8(search_text), |
655 find_options, wrap_around, 0); | 655 find_options, wrap_around, 0); |
656 frame->stopFinding(false); | 656 frame->stopFinding(WebLocalFrame::StopFindActionKeepSelection); |
657 return find_result; | 657 return find_result; |
658 } | 658 } |
659 | 659 |
660 std::string TestRunnerForSpecificView::SelectionAsMarkup() { | 660 std::string TestRunnerForSpecificView::SelectionAsMarkup() { |
661 return web_view()->mainFrame()->selectionAsMarkup().utf8(); | 661 return web_view()->mainFrame()->selectionAsMarkup().utf8(); |
662 } | 662 } |
663 | 663 |
664 void TestRunnerForSpecificView::SetViewSourceForFrame(const std::string& name, | 664 void TestRunnerForSpecificView::SetViewSourceForFrame(const std::string& name, |
665 bool enabled) { | 665 bool enabled) { |
666 WebFrame* target_frame = | 666 WebFrame* target_frame = |
667 web_view()->findFrameByName(WebString::fromUTF8(name)); | 667 web_view()->findFrameByName(WebString::fromUTF8(name)); |
668 if (target_frame) | 668 if (target_frame) |
669 target_frame->enableViewSourceMode(enabled); | 669 target_frame->enableViewSourceMode(enabled); |
670 } | 670 } |
671 | 671 |
672 blink::WebView* TestRunnerForSpecificView::web_view() { | 672 blink::WebView* TestRunnerForSpecificView::web_view() { |
673 return web_test_proxy_base_->web_view(); | 673 return web_test_proxy_base_->web_view(); |
674 } | 674 } |
675 | 675 |
676 WebTestDelegate* TestRunnerForSpecificView::delegate() { | 676 WebTestDelegate* TestRunnerForSpecificView::delegate() { |
677 return web_test_proxy_base_->delegate(); | 677 return web_test_proxy_base_->delegate(); |
678 } | 678 } |
679 | 679 |
680 } // namespace test_runner | 680 } // namespace test_runner |
OLD | NEW |