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

Side by Side Diff: components/html_viewer/html_frame.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/html_viewer/html_frame.h" 5 #include "components/html_viewer/html_frame.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <limits> 9 #include <limits>
10 #include <utility> 10 #include <utility>
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 } 926 }
927 927
928 void HTMLFrame::Find(int32_t request_id, 928 void HTMLFrame::Find(int32_t request_id,
929 const mojo::String& search_text, 929 const mojo::String& search_text,
930 web_view::mojom::FindOptionsPtr options, 930 web_view::mojom::FindOptionsPtr options,
931 bool wrap_within_frame, 931 bool wrap_within_frame,
932 const FindCallback& callback) { 932 const FindCallback& callback) {
933 blink::WebRect selection_rect; 933 blink::WebRect selection_rect;
934 bool result = web_frame_->find(request_id, search_text.To<blink::WebString>(), 934 bool result = web_frame_->find(request_id, search_text.To<blink::WebString>(),
935 options.To<blink::WebFindOptions>(), 935 options.To<blink::WebFindOptions>(),
936 wrap_within_frame, &selection_rect); 936 wrap_within_frame, &selection_rect, nullptr);
937 if (!result) { 937 if (!result) {
938 // don't leave text selected as you move to the next frame. 938 // don't leave text selected as you move to the next frame.
939 web_frame_->executeCommand(blink::WebString::fromUTF8("Unselect"), 939 web_frame_->executeCommand(blink::WebString::fromUTF8("Unselect"),
940 GetFocusedElement()); 940 GetFocusedElement());
941 } 941 }
942 942
943 callback.Run(result); 943 callback.Run(result);
944 } 944 }
945 945
946 void HTMLFrame::StopFinding(bool clear_selection) { 946 void HTMLFrame::StopFinding(bool clear_selection) {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 1040
1041 if (!surface_layer_) 1041 if (!surface_layer_)
1042 return; 1042 return;
1043 1043
1044 surface_layer_->SetSurfaceId(cc::SurfaceId(owned_window_->window()->id()), 1044 surface_layer_->SetSurfaceId(cc::SurfaceId(owned_window_->window()->id()),
1045 global_state()->device_pixel_ratio(), 1045 global_state()->device_pixel_ratio(),
1046 owned_window_->window()->bounds().size()); 1046 owned_window_->window()->bounds().size());
1047 } 1047 }
1048 1048
1049 } // namespace mojo 1049 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698