OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 class FilePath; | 61 class FilePath; |
62 class ListValue; | 62 class ListValue; |
63 } | 63 } |
64 | 64 |
65 namespace blink { | 65 namespace blink { |
66 namespace mojom { | 66 namespace mojom { |
67 class WebBluetoothService; | 67 class WebBluetoothService; |
68 } | 68 } |
69 } | 69 } |
70 | 70 |
| 71 namespace gfx { |
| 72 class Range; |
| 73 } |
| 74 |
71 namespace content { | 75 namespace content { |
72 class AppWebMessagePortMessageFilter; | 76 class AppWebMessagePortMessageFilter; |
73 class AssociatedInterfaceProviderImpl; | 77 class AssociatedInterfaceProviderImpl; |
74 class CrossProcessFrameConnector; | 78 class CrossProcessFrameConnector; |
75 class FrameTree; | 79 class FrameTree; |
76 class FrameTreeNode; | 80 class FrameTreeNode; |
77 class NavigationHandleImpl; | 81 class NavigationHandleImpl; |
78 class PermissionServiceContext; | 82 class PermissionServiceContext; |
79 class RenderFrameHostDelegate; | 83 class RenderFrameHostDelegate; |
80 class RenderFrameProxyHost; | 84 class RenderFrameProxyHost; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 void SaveImageAt(int x, int y) override; | 158 void SaveImageAt(int x, int y) override; |
155 RenderViewHost* GetRenderViewHost() override; | 159 RenderViewHost* GetRenderViewHost() override; |
156 shell::InterfaceRegistry* GetInterfaceRegistry() override; | 160 shell::InterfaceRegistry* GetInterfaceRegistry() override; |
157 shell::InterfaceProvider* GetRemoteInterfaces() override; | 161 shell::InterfaceProvider* GetRemoteInterfaces() override; |
158 AssociatedInterfaceProvider* GetRemoteAssociatedInterfaces() override; | 162 AssociatedInterfaceProvider* GetRemoteAssociatedInterfaces() override; |
159 blink::WebPageVisibilityState GetVisibilityState() override; | 163 blink::WebPageVisibilityState GetVisibilityState() override; |
160 bool IsRenderFrameLive() override; | 164 bool IsRenderFrameLive() override; |
161 int GetProxyCount() override; | 165 int GetProxyCount() override; |
162 void FilesSelectedInChooser(const std::vector<FileChooserFileInfo>& files, | 166 void FilesSelectedInChooser(const std::vector<FileChooserFileInfo>& files, |
163 FileChooserParams::Mode permissions) override; | 167 FileChooserParams::Mode permissions) override; |
| 168 bool HasSelection() override; |
164 void RequestTextSurroundingSelection( | 169 void RequestTextSurroundingSelection( |
165 const TextSurroundingSelectionCallback& callback, | 170 const TextSurroundingSelectionCallback& callback, |
166 int max_length) override; | 171 int max_length) override; |
167 | 172 |
168 // mojom::FrameHost | 173 // mojom::FrameHost |
169 void GetInterfaceProvider( | 174 void GetInterfaceProvider( |
170 shell::mojom::InterfaceProviderRequest interfaces) override; | 175 shell::mojom::InterfaceProviderRequest interfaces) override; |
171 | 176 |
172 // IPC::Sender | 177 // IPC::Sender |
173 bool Send(IPC::Message* msg) override; | 178 bool Send(IPC::Message* msg) override; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 // transfer navigations, where no DidStart/DidStopLoading notifications | 276 // transfer navigations, where no DidStart/DidStopLoading notifications |
272 // should be sent during the transfer. | 277 // should be sent during the transfer. |
273 // TODO(clamy): Remove this once PlzNavigate ships. | 278 // TODO(clamy): Remove this once PlzNavigate ships. |
274 void set_is_loading(bool is_loading) { is_loading_ = is_loading; } | 279 void set_is_loading(bool is_loading) { is_loading_ = is_loading; } |
275 | 280 |
276 // Returns true if this is a top-level frame, or if this frame's RenderFrame | 281 // Returns true if this is a top-level frame, or if this frame's RenderFrame |
277 // is in a different process from its parent frame. Local roots are | 282 // is in a different process from its parent frame. Local roots are |
278 // distinguished by owning a RenderWidgetHost, which manages input events | 283 // distinguished by owning a RenderWidgetHost, which manages input events |
279 // and painting for this frame and its contiguous local subtree in the | 284 // and painting for this frame and its contiguous local subtree in the |
280 // renderer process. | 285 // renderer process. |
281 bool is_local_root() { return !!render_widget_host_; } | 286 bool is_local_root() const { return !!render_widget_host_; } |
282 | 287 |
283 // Returns the RenderWidgetHostImpl attached to this frame or the nearest | 288 // Returns the RenderWidgetHostImpl attached to this frame or the nearest |
284 // ancestor frame, which could potentially be the root. For most input | 289 // ancestor frame, which could potentially be the root. For most input |
285 // and rendering related purposes, GetView() should be preferred and | 290 // and rendering related purposes, GetView() should be preferred and |
286 // RenderWidgetHostViewBase methods used. GetRenderWidgetHost() will not | 291 // RenderWidgetHostViewBase methods used. GetRenderWidgetHost() will not |
287 // return a nullptr, whereas GetView() potentially will (for instance, | 292 // return a nullptr, whereas GetView() potentially will (for instance, |
288 // after a renderer crash). | 293 // after a renderer crash). |
289 // | 294 // |
290 // This method crashes if this RenderFrameHostImpl does not own a | 295 // This method crashes if this RenderFrameHostImpl does not own a |
291 // a RenderWidgetHost and nor does any of its ancestors. That would | 296 // a RenderWidgetHost and nor does any of its ancestors. That would |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 const AXContentTreeUpdate& snapshot); | 717 const AXContentTreeUpdate& snapshot); |
713 void OnToggleFullscreen(bool enter_fullscreen); | 718 void OnToggleFullscreen(bool enter_fullscreen); |
714 void OnDidStartLoading(bool to_different_document); | 719 void OnDidStartLoading(bool to_different_document); |
715 void OnDidStopLoading(); | 720 void OnDidStopLoading(); |
716 void OnDidChangeLoadProgress(double load_progress); | 721 void OnDidChangeLoadProgress(double load_progress); |
717 void OnSerializeAsMHTMLResponse( | 722 void OnSerializeAsMHTMLResponse( |
718 int job_id, | 723 int job_id, |
719 bool success, | 724 bool success, |
720 const std::set<std::string>& digests_of_uris_of_serialized_resources, | 725 const std::set<std::string>& digests_of_uris_of_serialized_resources, |
721 base::TimeDelta renderer_main_thread_time); | 726 base::TimeDelta renderer_main_thread_time); |
| 727 void OnSelectionChanged(const base::string16& text, |
| 728 uint32_t offset, |
| 729 const gfx::Range& range); |
722 | 730 |
723 #if defined(USE_EXTERNAL_POPUP_MENU) | 731 #if defined(USE_EXTERNAL_POPUP_MENU) |
724 void OnShowPopup(const FrameHostMsg_ShowPopup_Params& params); | 732 void OnShowPopup(const FrameHostMsg_ShowPopup_Params& params); |
725 void OnHidePopup(); | 733 void OnHidePopup(); |
726 #endif | 734 #endif |
727 | 735 |
728 // Registers Mojo interfaces that this frame host makes available. | 736 // Registers Mojo interfaces that this frame host makes available. |
729 void RegisterMojoInterfaces(); | 737 void RegisterMojoInterfaces(); |
730 | 738 |
731 // Resets any waiting state of this RenderFrameHost that is no longer | 739 // Resets any waiting state of this RenderFrameHost that is no longer |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 void AXContentTreeDataToAXTreeData(ui::AXTreeData* dst); | 802 void AXContentTreeDataToAXTreeData(ui::AXTreeData* dst); |
795 | 803 |
796 // Returns the RenderWidgetHostView used for accessibility. For subframes, | 804 // Returns the RenderWidgetHostView used for accessibility. For subframes, |
797 // this function will return the platform view on the main frame; for main | 805 // this function will return the platform view on the main frame; for main |
798 // frames, it will return the current frame's view. | 806 // frames, it will return the current frame's view. |
799 RenderWidgetHostViewBase* GetViewForAccessibility(); | 807 RenderWidgetHostViewBase* GetViewForAccessibility(); |
800 | 808 |
801 // Sends a navigate message to the RenderFrame and notifies DevTools about | 809 // Sends a navigate message to the RenderFrame and notifies DevTools about |
802 // navigation happening. Should be used instead of sending the message | 810 // navigation happening. Should be used instead of sending the message |
803 // directly. | 811 // directly. |
804 void SendNavigateMessage( | 812 void SendNavigateMessage(const CommonNavigationParams& common_params, |
805 const content::CommonNavigationParams& common_params, | 813 const StartNavigationParams& start_params, |
806 const content::StartNavigationParams& start_params, | 814 const RequestNavigationParams& request_params); |
807 const content::RequestNavigationParams& request_params); | |
808 | 815 |
809 // Returns the child FrameTreeNode if |child_frame_routing_id| is an | 816 // Returns the child FrameTreeNode if |child_frame_routing_id| is an |
810 // immediate child of this FrameTreeNode. |child_frame_routing_id| is | 817 // immediate child of this FrameTreeNode. |child_frame_routing_id| is |
811 // considered untrusted, so the renderer process is killed if it refers to a | 818 // considered untrusted, so the renderer process is killed if it refers to a |
812 // FrameTreeNode that is not a child of this node. | 819 // FrameTreeNode that is not a child of this node. |
813 FrameTreeNode* FindAndVerifyChild(int32_t child_frame_routing_id, | 820 FrameTreeNode* FindAndVerifyChild(int32_t child_frame_routing_id, |
814 bad_message::BadMessageReason reason); | 821 bad_message::BadMessageReason reason); |
815 | 822 |
816 // Creates Web Bluetooth Service owned by the frame. Returns a raw pointer | 823 // Creates Web Bluetooth Service owned by the frame. Returns a raw pointer |
817 // to it. | 824 // to it. |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 // The pending WebUIImpl and its type. These values will be used exclusively | 1041 // The pending WebUIImpl and its type. These values will be used exclusively |
1035 // for same-site navigations to keep a transition of a WebUI in a pending | 1042 // for same-site navigations to keep a transition of a WebUI in a pending |
1036 // state until the navigation commits. | 1043 // state until the navigation commits. |
1037 std::unique_ptr<WebUIImpl> pending_web_ui_; | 1044 std::unique_ptr<WebUIImpl> pending_web_ui_; |
1038 WebUI::TypeID pending_web_ui_type_; | 1045 WebUI::TypeID pending_web_ui_type_; |
1039 | 1046 |
1040 // If true the associated WebUI should be reused when CommitPendingWebUI is | 1047 // If true the associated WebUI should be reused when CommitPendingWebUI is |
1041 // called (no pending instance should be set). | 1048 // called (no pending instance should be set). |
1042 bool should_reuse_web_ui_; | 1049 bool should_reuse_web_ui_; |
1043 | 1050 |
| 1051 bool has_selection_; |
| 1052 |
1044 // PlzNavigate: The LoFi state of the last navigation. This is used during | 1053 // PlzNavigate: The LoFi state of the last navigation. This is used during |
1045 // history navigation of subframes to ensure that subframes navigate with the | 1054 // history navigation of subframes to ensure that subframes navigate with the |
1046 // same LoFi status as the top-level frame. | 1055 // same LoFi status as the top-level frame. |
1047 LoFiState last_navigation_lofi_state_; | 1056 LoFiState last_navigation_lofi_state_; |
1048 | 1057 |
1049 mojo::Binding<mojom::FrameHost> frame_host_binding_; | 1058 mojo::Binding<mojom::FrameHost> frame_host_binding_; |
1050 mojom::FramePtr frame_; | 1059 mojom::FramePtr frame_; |
1051 | 1060 |
1052 // Callback for responding when | 1061 // Callback for responding when |
1053 // |FrameHostMsg_TextSurroundingSelectionResponse| message comes. | 1062 // |FrameHostMsg_TextSurroundingSelectionResponse| message comes. |
1054 TextSurroundingSelectionCallback text_surrounding_selection_callback_; | 1063 TextSurroundingSelectionCallback text_surrounding_selection_callback_; |
1055 | 1064 |
1056 std::vector<std::unique_ptr<shell::InterfaceRegistry>> media_registries_; | 1065 std::vector<std::unique_ptr<shell::InterfaceRegistry>> media_registries_; |
1057 | 1066 |
1058 std::unique_ptr<AssociatedInterfaceProviderImpl> | 1067 std::unique_ptr<AssociatedInterfaceProviderImpl> |
1059 remote_associated_interfaces_; | 1068 remote_associated_interfaces_; |
1060 // NOTE: This must be the last member. | 1069 // NOTE: This must be the last member. |
1061 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; | 1070 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; |
1062 | 1071 |
1063 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 1072 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
1064 }; | 1073 }; |
1065 | 1074 |
1066 } // namespace content | 1075 } // namespace content |
1067 | 1076 |
1068 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 1077 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
OLD | NEW |