OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |