| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 delegate_(delegate), | 139 delegate_(delegate), |
| 140 instance_(static_cast<SiteInstanceImpl*>(instance)), | 140 instance_(static_cast<SiteInstanceImpl*>(instance)), |
| 141 waiting_for_drag_context_response_(false), | 141 waiting_for_drag_context_response_(false), |
| 142 enabled_bindings_(0), | 142 enabled_bindings_(0), |
| 143 guest_(false), | 143 guest_(false), |
| 144 pending_request_id_(-1), | 144 pending_request_id_(-1), |
| 145 navigations_suspended_(false), | 145 navigations_suspended_(false), |
| 146 suspended_nav_message_(NULL), | 146 suspended_nav_message_(NULL), |
| 147 is_swapped_out_(swapped_out), | 147 is_swapped_out_(swapped_out), |
| 148 run_modal_reply_msg_(NULL), | 148 run_modal_reply_msg_(NULL), |
| 149 run_modal_opener_id_(MSG_ROUTING_NONE), |
| 149 is_waiting_for_beforeunload_ack_(false), | 150 is_waiting_for_beforeunload_ack_(false), |
| 150 is_waiting_for_unload_ack_(false), | 151 is_waiting_for_unload_ack_(false), |
| 151 unload_ack_is_for_cross_site_transition_(false), | 152 unload_ack_is_for_cross_site_transition_(false), |
| 152 are_javascript_messages_suppressed_(false), | 153 are_javascript_messages_suppressed_(false), |
| 153 sudden_termination_allowed_(false), | 154 sudden_termination_allowed_(false), |
| 154 session_storage_namespace_( | 155 session_storage_namespace_( |
| 155 static_cast<SessionStorageNamespaceImpl*>(session_storage)), | 156 static_cast<SessionStorageNamespaceImpl*>(session_storage)), |
| 156 save_accessibility_tree_for_testing_(false), | 157 save_accessibility_tree_for_testing_(false), |
| 157 send_accessibility_updated_notifications_(false), | 158 send_accessibility_updated_notifications_(false), |
| 158 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) { | 159 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) { |
| (...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 919 } | 920 } |
| 920 | 921 |
| 921 return handled; | 922 return handled; |
| 922 } | 923 } |
| 923 | 924 |
| 924 void RenderViewHostImpl::Shutdown() { | 925 void RenderViewHostImpl::Shutdown() { |
| 925 // If we are being run modally (see RunModal), then we need to cleanup. | 926 // If we are being run modally (see RunModal), then we need to cleanup. |
| 926 if (run_modal_reply_msg_) { | 927 if (run_modal_reply_msg_) { |
| 927 Send(run_modal_reply_msg_); | 928 Send(run_modal_reply_msg_); |
| 928 run_modal_reply_msg_ = NULL; | 929 run_modal_reply_msg_ = NULL; |
| 930 RenderViewHostImpl* opener = |
| 931 RenderViewHostImpl::FromID(GetProcess()->GetID(), run_modal_opener_id_); |
| 932 if (opener) { |
| 933 opener->StartHangMonitorTimeout(TimeDelta::FromMilliseconds( |
| 934 hung_renderer_delay_ms_)); |
| 935 // Balance out the decrement when we got created. |
| 936 opener->increment_in_flight_event_count(); |
| 937 } |
| 938 run_modal_opener_id_ = MSG_ROUTING_NONE; |
| 929 } | 939 } |
| 930 | 940 |
| 931 RenderWidgetHostImpl::Shutdown(); | 941 RenderWidgetHostImpl::Shutdown(); |
| 932 } | 942 } |
| 933 | 943 |
| 934 bool RenderViewHostImpl::IsRenderView() const { | 944 bool RenderViewHostImpl::IsRenderView() const { |
| 935 return true; | 945 return true; |
| 936 } | 946 } |
| 937 | 947 |
| 938 void RenderViewHostImpl::CreateNewWindow( | 948 void RenderViewHostImpl::CreateNewWindow( |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 | 992 |
| 983 void RenderViewHostImpl::OnMsgShowFullscreenWidget(int route_id) { | 993 void RenderViewHostImpl::OnMsgShowFullscreenWidget(int route_id) { |
| 984 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); | 994 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); |
| 985 if (view) { | 995 if (view) { |
| 986 if (!is_swapped_out_) | 996 if (!is_swapped_out_) |
| 987 view->ShowCreatedFullscreenWidget(route_id); | 997 view->ShowCreatedFullscreenWidget(route_id); |
| 988 Send(new ViewMsg_Move_ACK(route_id)); | 998 Send(new ViewMsg_Move_ACK(route_id)); |
| 989 } | 999 } |
| 990 } | 1000 } |
| 991 | 1001 |
| 992 void RenderViewHostImpl::OnMsgRunModal(IPC::Message* reply_msg) { | 1002 void RenderViewHostImpl::OnMsgRunModal(int opener_id, IPC::Message* reply_msg) { |
| 993 DCHECK(!run_modal_reply_msg_); | 1003 DCHECK(!run_modal_reply_msg_); |
| 994 run_modal_reply_msg_ = reply_msg; | 1004 run_modal_reply_msg_ = reply_msg; |
| 1005 run_modal_opener_id_ = opener_id; |
| 995 | 1006 |
| 996 content::RecordAction(UserMetricsAction("ShowModalDialog")); | 1007 content::RecordAction(UserMetricsAction("ShowModalDialog")); |
| 997 | 1008 |
| 1009 RenderViewHostImpl* opener = |
| 1010 RenderViewHostImpl::FromID(GetProcess()->GetID(), run_modal_opener_id_); |
| 1011 opener->StopHangMonitorTimeout(); |
| 1012 // The ack for the mouse down won't come until the dialog closes, so fake it |
| 1013 // so that we don't get a timeout. |
| 1014 opener->decrement_in_flight_event_count(); |
| 1015 |
| 998 // TODO(darin): Bug 1107929: Need to inform our delegate to show this view in | 1016 // TODO(darin): Bug 1107929: Need to inform our delegate to show this view in |
| 999 // an app-modal fashion. | 1017 // an app-modal fashion. |
| 1000 } | 1018 } |
| 1001 | 1019 |
| 1002 void RenderViewHostImpl::OnMsgRenderViewReady() { | 1020 void RenderViewHostImpl::OnMsgRenderViewReady() { |
| 1003 render_view_termination_status_ = base::TERMINATION_STATUS_STILL_RUNNING; | 1021 render_view_termination_status_ = base::TERMINATION_STATUS_STILL_RUNNING; |
| 1004 WasResized(); | 1022 WasResized(); |
| 1005 delegate_->RenderViewReady(this); | 1023 delegate_->RenderViewReady(this); |
| 1006 } | 1024 } |
| 1007 | 1025 |
| (...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1803 // can cause navigations to be ignored in OnMsgNavigate. | 1821 // can cause navigations to be ignored in OnMsgNavigate. |
| 1804 is_waiting_for_beforeunload_ack_ = false; | 1822 is_waiting_for_beforeunload_ack_ = false; |
| 1805 is_waiting_for_unload_ack_ = false; | 1823 is_waiting_for_unload_ack_ = false; |
| 1806 } | 1824 } |
| 1807 | 1825 |
| 1808 void RenderViewHostImpl::ClearPowerSaveBlockers() { | 1826 void RenderViewHostImpl::ClearPowerSaveBlockers() { |
| 1809 STLDeleteValues(&power_save_blockers_); | 1827 STLDeleteValues(&power_save_blockers_); |
| 1810 } | 1828 } |
| 1811 | 1829 |
| 1812 } // namespace content | 1830 } // namespace content |
| OLD | NEW |