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

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: small clean up 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 2350 matching lines...) Expand 10 before | Expand all | Expand 10 after
2361 else if (option == "AtWordStarts") 2361 else if (option == "AtWordStarts")
2362 find_options.wordStart = true; 2362 find_options.wordStart = true;
2363 else if (option == "TreatMedialCapitalAsWordStart") 2363 else if (option == "TreatMedialCapitalAsWordStart")
2364 find_options.medialCapitalAsWordStart = true; 2364 find_options.medialCapitalAsWordStart = true;
2365 else if (option == "WrapAround") 2365 else if (option == "WrapAround")
2366 wrap_around = true; 2366 wrap_around = true;
2367 } 2367 }
2368 2368
2369 WebFrame* frame = web_view_->mainFrame(); 2369 WebFrame* frame = web_view_->mainFrame();
2370 const bool find_result = frame->find(0, WebString::fromUTF8(search_text), 2370 const bool find_result = frame->find(0, WebString::fromUTF8(search_text),
2371 find_options, wrap_around, 0); 2371 find_options, wrap_around, 0, nullptr);
2372 frame->stopFinding(false); 2372 frame->stopFinding(false);
2373 return find_result; 2373 return find_result;
2374 } 2374 }
2375 2375
2376 std::string TestRunner::SelectionAsMarkup() { 2376 std::string TestRunner::SelectionAsMarkup() {
2377 return web_view_->mainFrame()->selectionAsMarkup().utf8(); 2377 return web_view_->mainFrame()->selectionAsMarkup().utf8();
2378 } 2378 }
2379 2379
2380 void TestRunner::SetTextSubpixelPositioning(bool value) { 2380 void TestRunner::SetTextSubpixelPositioning(bool value) {
2381 #if defined(__linux__) || defined(ANDROID) 2381 #if defined(__linux__) || defined(ANDROID)
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
3188 } 3188 }
3189 3189
3190 void TestRunner::DidLosePointerLockInternal() { 3190 void TestRunner::DidLosePointerLockInternal() {
3191 bool was_locked = pointer_locked_; 3191 bool was_locked = pointer_locked_;
3192 pointer_locked_ = false; 3192 pointer_locked_ = false;
3193 if (was_locked) 3193 if (was_locked)
3194 web_view_->didLosePointerLock(); 3194 web_view_->didLosePointerLock();
3195 } 3195 }
3196 3196
3197 } // namespace test_runner 3197 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698