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