| 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> |
| 8 |
| 7 #include <algorithm> | 9 #include <algorithm> |
| 8 #include <limits> | 10 #include <limits> |
| 9 | 11 |
| 10 #include "base/bind.h" | 12 #include "base/bind.h" |
| 11 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
| 12 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
| 13 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 14 #include "base/thread_task_runner_handle.h" | 16 #include "base/thread_task_runner_handle.h" |
| 15 #include "cc/blink/web_layer_impl.h" | 17 #include "cc/blink/web_layer_impl.h" |
| 16 #include "cc/surfaces/surface_id.h" | 18 #include "cc/surfaces/surface_id.h" |
| (...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 frame->web_frame_->toWebRemoteFrame()->didStopLoading(); | 915 frame->web_frame_->toWebRemoteFrame()->didStopLoading(); |
| 914 } | 916 } |
| 915 } | 917 } |
| 916 | 918 |
| 917 void HTMLFrame::OnDispatchFrameLoadEvent(uint32_t frame_id) { | 919 void HTMLFrame::OnDispatchFrameLoadEvent(uint32_t frame_id) { |
| 918 HTMLFrame* frame = frame_tree_manager_->root_->FindFrame(frame_id); | 920 HTMLFrame* frame = frame_tree_manager_->root_->FindFrame(frame_id); |
| 919 if (frame && !frame->IsLocal()) | 921 if (frame && !frame->IsLocal()) |
| 920 frame->web_frame_->toWebRemoteFrame()->DispatchLoadEventForFrameOwner(); | 922 frame->web_frame_->toWebRemoteFrame()->DispatchLoadEventForFrameOwner(); |
| 921 } | 923 } |
| 922 | 924 |
| 923 void HTMLFrame::Find(int32 request_id, | 925 void HTMLFrame::Find(int32_t request_id, |
| 924 const mojo::String& search_text, | 926 const mojo::String& search_text, |
| 925 web_view::mojom::FindOptionsPtr options, | 927 web_view::mojom::FindOptionsPtr options, |
| 926 bool wrap_within_frame, | 928 bool wrap_within_frame, |
| 927 const FindCallback& callback) { | 929 const FindCallback& callback) { |
| 928 blink::WebRect selection_rect; | 930 blink::WebRect selection_rect; |
| 929 bool result = web_frame_->find(request_id, search_text.To<blink::WebString>(), | 931 bool result = web_frame_->find(request_id, search_text.To<blink::WebString>(), |
| 930 options.To<blink::WebFindOptions>(), | 932 options.To<blink::WebFindOptions>(), |
| 931 wrap_within_frame, &selection_rect); | 933 wrap_within_frame, &selection_rect); |
| 932 if (!result) { | 934 if (!result) { |
| 933 // don't leave text selected as you move to the next frame. | 935 // don't leave text selected as you move to the next frame. |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1035 | 1037 |
| 1036 if (!surface_layer_) | 1038 if (!surface_layer_) |
| 1037 return; | 1039 return; |
| 1038 | 1040 |
| 1039 surface_layer_->SetSurfaceId(cc::SurfaceId(owned_window_->window()->id()), | 1041 surface_layer_->SetSurfaceId(cc::SurfaceId(owned_window_->window()->id()), |
| 1040 global_state()->device_pixel_ratio(), | 1042 global_state()->device_pixel_ratio(), |
| 1041 owned_window_->window()->bounds().size()); | 1043 owned_window_->window()->bounds().size()); |
| 1042 } | 1044 } |
| 1043 | 1045 |
| 1044 } // namespace mojo | 1046 } // namespace mojo |
| OLD | NEW |