| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 // is important that only one navigation event happen after calling this | 142 // is important that only one navigation event happen after calling this |
| 143 // method with |suspend| equal to true. If |suspend| is false and there is | 143 // method with |suspend| equal to true. If |suspend| is false and there is |
| 144 // a suspended_nav_message_, this will send the message. This function | 144 // a suspended_nav_message_, this will send the message. This function |
| 145 // should only be called to toggle the state; callers should check | 145 // should only be called to toggle the state; callers should check |
| 146 // are_navigations_suspended() first. | 146 // are_navigations_suspended() first. |
| 147 void SetNavigationsSuspended(bool suspend); | 147 void SetNavigationsSuspended(bool suspend); |
| 148 | 148 |
| 149 // Causes the renderer to invoke the onbeforeunload event handler. The | 149 // Causes the renderer to invoke the onbeforeunload event handler. The |
| 150 // result will be returned via ViewMsg_ShouldClose. See also ClosePage which | 150 // result will be returned via ViewMsg_ShouldClose. See also ClosePage which |
| 151 // will fire the PageUnload event. | 151 // will fire the PageUnload event. |
| 152 void FirePageBeforeUnload(); | 152 // |
| 153 // Set bool for_cross_site_transition when this close is just for the current |
| 154 // RenderView in the case of a cross-site transition. False means we're |
| 155 // closing the entire tab. |
| 156 void FirePageBeforeUnload(bool for_cross_site_transition); |
| 153 | 157 |
| 154 // Causes the renderer to close the current page, including running its | 158 // Causes the renderer to close the current page, including running its |
| 155 // onunload event handler. A ClosePage_ACK message will be sent to the | 159 // onunload event handler. A ClosePage_ACK message will be sent to the |
| 156 // ResourceDispatcherHost when it is finished. | 160 // ResourceDispatcherHost when it is finished. |
| 157 // | 161 // |
| 158 // Please see ViewMsg_ClosePage in resource_messages_internal.h for a | 162 // Please see ViewMsg_ClosePage in resource_messages_internal.h for a |
| 159 // description of the parameters. | 163 // description of the parameters. |
| 160 void ClosePage(bool for_cross_site_transition, | 164 void ClosePage(bool for_cross_site_transition, |
| 161 int new_render_process_host_id, | 165 int new_render_process_host_id, |
| 162 int new_request_id); | 166 int new_request_id); |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 // We only buffer a suspended navigation message while we a pending RVH for a | 614 // We only buffer a suspended navigation message while we a pending RVH for a |
| 611 // TabContents. There will only ever be one suspended navigation, because | 615 // TabContents. There will only ever be one suspended navigation, because |
| 612 // TabContents will destroy the pending RVH and create a new one if a second | 616 // TabContents will destroy the pending RVH and create a new one if a second |
| 613 // navigation occurs. | 617 // navigation occurs. |
| 614 scoped_ptr<ViewMsg_Navigate> suspended_nav_message_; | 618 scoped_ptr<ViewMsg_Navigate> suspended_nav_message_; |
| 615 | 619 |
| 616 // If we were asked to RunModal, then this will hold the reply_msg that we | 620 // If we were asked to RunModal, then this will hold the reply_msg that we |
| 617 // must return to the renderer to unblock it. | 621 // must return to the renderer to unblock it. |
| 618 IPC::Message* run_modal_reply_msg_; | 622 IPC::Message* run_modal_reply_msg_; |
| 619 | 623 |
| 624 // Set to true when there is a pending ViewMsg_ShouldClose message pending. |
| 625 // This ensures we don't spam the renderer many times to close. When true, |
| 626 // the value of unload_ack_is_for_cross_site_transition_ indicates which type |
| 627 // of unload this is for. |
| 620 bool is_waiting_for_unload_ack_; | 628 bool is_waiting_for_unload_ack_; |
| 621 | 629 |
| 630 // Valid only when is_waiting_for_unload_ack_ is true, this tells us if the |
| 631 // unload request is for closing the entire tab ( = false), or only this |
| 632 // RenderViewHost in the case of a cross-site transition ( = true). |
| 633 bool unload_ack_is_for_cross_site_transition_; |
| 634 |
| 622 bool are_javascript_messages_suppressed_; | 635 bool are_javascript_messages_suppressed_; |
| 623 | 636 |
| 624 // True if the render view can be shut down suddenly. | 637 // True if the render view can be shut down suddenly. |
| 625 bool sudden_termination_allowed_; | 638 bool sudden_termination_allowed_; |
| 626 | 639 |
| 627 // DevTools triggers this mode when user chooses inspect lens tool. | 640 // DevTools triggers this mode when user chooses inspect lens tool. |
| 628 // While in this mode, mouse click is converted into InspectElement | 641 // While in this mode, mouse click is converted into InspectElement |
| 629 // command. | 642 // command. |
| 630 bool in_inspect_element_mode_; | 643 bool in_inspect_element_mode_; |
| 631 | 644 |
| 632 NotificationRegistrar registrar_; | 645 NotificationRegistrar registrar_; |
| 633 | 646 |
| 634 DISALLOW_COPY_AND_ASSIGN(RenderViewHost); | 647 DISALLOW_COPY_AND_ASSIGN(RenderViewHost); |
| 635 }; | 648 }; |
| 636 | 649 |
| 637 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ | 650 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_H_ |
| OLD | NEW |