| 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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 void DispatchBeforeUnload(bool for_navigation, bool is_reload); | 425 void DispatchBeforeUnload(bool for_navigation, bool is_reload); |
| 426 | 426 |
| 427 // Simulate beforeunload ack on behalf of renderer if it's unrenresponsive. | 427 // Simulate beforeunload ack on behalf of renderer if it's unrenresponsive. |
| 428 void SimulateBeforeUnloadAck(); | 428 void SimulateBeforeUnloadAck(); |
| 429 | 429 |
| 430 // Returns true if a call to DispatchBeforeUnload will actually send the | 430 // Returns true if a call to DispatchBeforeUnload will actually send the |
| 431 // BeforeUnload IPC. This is the case if the current renderer is live and this | 431 // BeforeUnload IPC. This is the case if the current renderer is live and this |
| 432 // frame is the main frame. | 432 // frame is the main frame. |
| 433 bool ShouldDispatchBeforeUnload(); | 433 bool ShouldDispatchBeforeUnload(); |
| 434 | 434 |
| 435 // Returns true if the frame or any of its descendents have an onunload | |
| 436 // handler. | |
| 437 bool ShouldDispatchUnload(); | |
| 438 | |
| 439 // Update the frame's opener in the renderer process in response to the | 435 // Update the frame's opener in the renderer process in response to the |
| 440 // opener being modified (e.g., with window.open or being set to null) in | 436 // opener being modified (e.g., with window.open or being set to null) in |
| 441 // another renderer process. | 437 // another renderer process. |
| 442 void UpdateOpener(); | 438 void UpdateOpener(); |
| 443 | 439 |
| 444 // Set this frame as focused in the renderer process. This supports | 440 // Set this frame as focused in the renderer process. This supports |
| 445 // cross-process window.focus() calls. | 441 // cross-process window.focus() calls. |
| 446 void SetFocusedFrame(); | 442 void SetFocusedFrame(); |
| 447 | 443 |
| 448 // Continues sequential focus navigation in this frame. |source_proxy| | 444 // Continues sequential focus navigation in this frame. |source_proxy| |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 void OnAccessibilityChildFrameHitTestResult(const gfx::Point& point, | 754 void OnAccessibilityChildFrameHitTestResult(const gfx::Point& point, |
| 759 int hit_obj_id, | 755 int hit_obj_id, |
| 760 ui::AXEvent event_to_fire); | 756 ui::AXEvent event_to_fire); |
| 761 void OnAccessibilitySnapshotResponse( | 757 void OnAccessibilitySnapshotResponse( |
| 762 int callback_id, | 758 int callback_id, |
| 763 const AXContentTreeUpdate& snapshot); | 759 const AXContentTreeUpdate& snapshot); |
| 764 void OnSmartClipDataExtracted(uint32_t id, | 760 void OnSmartClipDataExtracted(uint32_t id, |
| 765 base::string16 text, | 761 base::string16 text, |
| 766 base::string16 html); | 762 base::string16 html); |
| 767 void OnToggleFullscreen(bool enter_fullscreen); | 763 void OnToggleFullscreen(bool enter_fullscreen); |
| 768 void OnBeforeUnloadHandlersPresent(bool present); | |
| 769 void OnUnloadHandlersPresent(bool present); | |
| 770 void OnDidStartLoading(bool to_different_document); | 764 void OnDidStartLoading(bool to_different_document); |
| 771 void OnDidStopLoading(); | 765 void OnDidStopLoading(); |
| 772 void OnDidChangeLoadProgress(double load_progress); | 766 void OnDidChangeLoadProgress(double load_progress); |
| 773 void OnSerializeAsMHTMLResponse( | 767 void OnSerializeAsMHTMLResponse( |
| 774 int job_id, | 768 int job_id, |
| 775 MhtmlSaveStatus save_status, | 769 MhtmlSaveStatus save_status, |
| 776 const std::set<std::string>& digests_of_uris_of_serialized_resources, | 770 const std::set<std::string>& digests_of_uris_of_serialized_resources, |
| 777 base::TimeDelta renderer_main_thread_time); | 771 base::TimeDelta renderer_main_thread_time); |
| 778 void OnSelectionChanged(const base::string16& text, | 772 void OnSelectionChanged(const base::string16& text, |
| 779 uint32_t offset, | 773 uint32_t offset, |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 993 // this RFH is the pending RenderFrameHost of a RenderFrameHostManager. There | 987 // this RFH is the pending RenderFrameHost of a RenderFrameHostManager. There |
| 994 // will only ever be one suspended navigation, because RenderFrameHostManager | 988 // will only ever be one suspended navigation, because RenderFrameHostManager |
| 995 // will destroy the pending RenderFrameHost and create a new one if a second | 989 // will destroy the pending RenderFrameHost and create a new one if a second |
| 996 // navigation occurs. | 990 // navigation occurs. |
| 997 // PlzNavigate: unused as navigations are never suspended. | 991 // PlzNavigate: unused as navigations are never suspended. |
| 998 std::unique_ptr<NavigationParams> suspended_nav_params_; | 992 std::unique_ptr<NavigationParams> suspended_nav_params_; |
| 999 | 993 |
| 1000 // When the last BeforeUnload message was sent. | 994 // When the last BeforeUnload message was sent. |
| 1001 base::TimeTicks send_before_unload_start_time_; | 995 base::TimeTicks send_before_unload_start_time_; |
| 1002 | 996 |
| 1003 // Used to track whether the frame has onbeforeunload and onunload handlers | |
| 1004 bool has_beforeunload_handlers_; | |
| 1005 bool has_unload_handlers_; | |
| 1006 | |
| 1007 // Set to true when there is a pending FrameMsg_BeforeUnload message. This | 997 // Set to true when there is a pending FrameMsg_BeforeUnload message. This |
| 1008 // ensures we don't spam the renderer with multiple beforeunload requests. | 998 // ensures we don't spam the renderer with multiple beforeunload requests. |
| 1009 // When either this value or IsWaitingForUnloadACK is true, the value of | 999 // When either this value or IsWaitingForUnloadACK is true, the value of |
| 1010 // unload_ack_is_for_cross_site_transition_ indicates whether this is for a | 1000 // unload_ack_is_for_cross_site_transition_ indicates whether this is for a |
| 1011 // cross-site transition or a tab close attempt. | 1001 // cross-site transition or a tab close attempt. |
| 1012 // TODO(clamy): Remove this boolean and add one more state to the state | 1002 // TODO(clamy): Remove this boolean and add one more state to the state |
| 1013 // machine. | 1003 // machine. |
| 1014 bool is_waiting_for_beforeunload_ack_; | 1004 bool is_waiting_for_beforeunload_ack_; |
| 1015 | 1005 |
| 1016 // Valid only when is_waiting_for_beforeunload_ack_ or | 1006 // Valid only when is_waiting_for_beforeunload_ack_ or |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1184 | 1174 |
| 1185 // NOTE: This must be the last member. | 1175 // NOTE: This must be the last member. |
| 1186 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; | 1176 base::WeakPtrFactory<RenderFrameHostImpl> weak_ptr_factory_; |
| 1187 | 1177 |
| 1188 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); | 1178 DISALLOW_COPY_AND_ASSIGN(RenderFrameHostImpl); |
| 1189 }; | 1179 }; |
| 1190 | 1180 |
| 1191 } // namespace content | 1181 } // namespace content |
| 1192 | 1182 |
| 1193 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ | 1183 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_IMPL_H_ |
| OLD | NEW |