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

Side by Side Diff: components/test_runner/test_runner.cc

Issue 1605863002: Restart search in page when new text is found. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 10 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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.h" 5 #include "components/test_runner/test_runner.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 2385 matching lines...) Expand 10 before | Expand all | Expand 10 after
2396 else if (option == "AtWordStarts") 2396 else if (option == "AtWordStarts")
2397 find_options.wordStart = true; 2397 find_options.wordStart = true;
2398 else if (option == "TreatMedialCapitalAsWordStart") 2398 else if (option == "TreatMedialCapitalAsWordStart")
2399 find_options.medialCapitalAsWordStart = true; 2399 find_options.medialCapitalAsWordStart = true;
2400 else if (option == "WrapAround") 2400 else if (option == "WrapAround")
2401 wrap_around = true; 2401 wrap_around = true;
2402 } 2402 }
2403 2403
2404 WebLocalFrame* frame = web_view_->mainFrame()->toWebLocalFrame(); 2404 WebLocalFrame* frame = web_view_->mainFrame()->toWebLocalFrame();
2405 const bool find_result = frame->find(0, WebString::fromUTF8(search_text), 2405 const bool find_result = frame->find(0, WebString::fromUTF8(search_text),
2406 find_options, wrap_around, 0); 2406 find_options, wrap_around, 0, nullptr);
2407 frame->stopFinding(false); 2407 frame->stopFinding(false);
2408 return find_result; 2408 return find_result;
2409 } 2409 }
2410 2410
2411 std::string TestRunner::SelectionAsMarkup() { 2411 std::string TestRunner::SelectionAsMarkup() {
2412 return web_view_->mainFrame()->selectionAsMarkup().utf8(); 2412 return web_view_->mainFrame()->selectionAsMarkup().utf8();
2413 } 2413 }
2414 2414
2415 void TestRunner::SetTextSubpixelPositioning(bool value) { 2415 void TestRunner::SetTextSubpixelPositioning(bool value) {
2416 #if defined(__linux__) || defined(ANDROID) 2416 #if defined(__linux__) || defined(ANDROID)
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
3228 } 3228 }
3229 3229
3230 void TestRunner::DidLosePointerLockInternal() { 3230 void TestRunner::DidLosePointerLockInternal() {
3231 bool was_locked = pointer_locked_; 3231 bool was_locked = pointer_locked_;
3232 pointer_locked_ = false; 3232 pointer_locked_ = false;
3233 if (was_locked) 3233 if (was_locked)
3234 web_view_->didLosePointerLock(); 3234 web_view_->didLosePointerLock();
3235 } 3235 }
3236 3236
3237 } // namespace test_runner 3237 } // namespace test_runner
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_frame_impl.cc » ('j') | third_party/WebKit/Source/web/TextFinder.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698