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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 bool hidden) | 177 bool hidden) |
178 : RenderWidgetHostImpl(widget_delegate, | 178 : RenderWidgetHostImpl(widget_delegate, |
179 instance->GetProcess(), | 179 instance->GetProcess(), |
180 routing_id, | 180 routing_id, |
181 hidden), | 181 hidden), |
182 frames_ref_count_(0), | 182 frames_ref_count_(0), |
183 delegate_(delegate), | 183 delegate_(delegate), |
184 instance_(static_cast<SiteInstanceImpl*>(instance)), | 184 instance_(static_cast<SiteInstanceImpl*>(instance)), |
185 waiting_for_drag_context_response_(false), | 185 waiting_for_drag_context_response_(false), |
186 enabled_bindings_(0), | 186 enabled_bindings_(0), |
187 page_id_(-1), | |
188 main_frame_routing_id_(main_frame_routing_id), | 187 main_frame_routing_id_(main_frame_routing_id), |
189 run_modal_reply_msg_(NULL), | 188 run_modal_reply_msg_(NULL), |
190 run_modal_opener_id_(MSG_ROUTING_NONE), | 189 run_modal_opener_id_(MSG_ROUTING_NONE), |
191 is_waiting_for_beforeunload_ack_(false), | 190 is_waiting_for_beforeunload_ack_(false), |
192 unload_ack_is_for_cross_site_transition_(false), | 191 unload_ack_is_for_cross_site_transition_(false), |
193 sudden_termination_allowed_(false), | 192 sudden_termination_allowed_(false), |
194 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING), | 193 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING), |
195 virtual_keyboard_requested_(false), | 194 virtual_keyboard_requested_(false), |
196 weak_factory_(this), | 195 weak_factory_(this), |
197 is_focused_element_editable_(false), | 196 is_focused_element_editable_(false), |
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 | 1066 |
1068 // Our base class RenderWidgetHost needs to reset some stuff. | 1067 // Our base class RenderWidgetHost needs to reset some stuff. |
1069 RendererExited(render_view_termination_status_, exit_code); | 1068 RendererExited(render_view_termination_status_, exit_code); |
1070 | 1069 |
1071 delegate_->RenderViewTerminated(this, | 1070 delegate_->RenderViewTerminated(this, |
1072 static_cast<base::TerminationStatus>(status), | 1071 static_cast<base::TerminationStatus>(status), |
1073 exit_code); | 1072 exit_code); |
1074 } | 1073 } |
1075 | 1074 |
1076 void RenderViewHostImpl::OnUpdateState(int32 page_id, const PageState& state) { | 1075 void RenderViewHostImpl::OnUpdateState(int32 page_id, const PageState& state) { |
1077 CHECK_EQ(page_id_, page_id); | |
1078 // Without this check, the renderer can trick the browser into using | 1076 // Without this check, the renderer can trick the browser into using |
1079 // filenames it can't access in a future session restore. | 1077 // filenames it can't access in a future session restore. |
1080 if (!CanAccessFilesOfPageState(state)) { | 1078 if (!CanAccessFilesOfPageState(state)) { |
1081 GetProcess()->ReceivedBadMessage(); | 1079 GetProcess()->ReceivedBadMessage(); |
1082 return; | 1080 return; |
1083 } | 1081 } |
1084 | 1082 |
1085 delegate_->UpdateState(this, page_id_, state); | 1083 delegate_->UpdateState(this, page_id, state); |
1086 } | 1084 } |
1087 | 1085 |
1088 void RenderViewHostImpl::OnUpdateTargetURL(int32 page_id, const GURL& url) { | 1086 void RenderViewHostImpl::OnUpdateTargetURL(int32 page_id, const GURL& url) { |
1089 CHECK_EQ(page_id_, page_id); | |
1090 if (IsRVHStateActive(rvh_state_)) | 1087 if (IsRVHStateActive(rvh_state_)) |
1091 delegate_->UpdateTargetURL(page_id_, url); | 1088 delegate_->UpdateTargetURL(page_id, url); |
1092 | 1089 |
1093 // Send a notification back to the renderer that we are ready to | 1090 // Send a notification back to the renderer that we are ready to |
1094 // receive more target urls. | 1091 // receive more target urls. |
1095 Send(new ViewMsg_UpdateTargetURL_ACK(GetRoutingID())); | 1092 Send(new ViewMsg_UpdateTargetURL_ACK(GetRoutingID())); |
1096 } | 1093 } |
1097 | 1094 |
1098 void RenderViewHostImpl::OnClose() { | 1095 void RenderViewHostImpl::OnClose() { |
1099 // If the renderer is telling us to close, it has already run the unload | 1096 // If the renderer is telling us to close, it has already run the unload |
1100 // events, and we can take the fast path. | 1097 // events, and we can take the fast path. |
1101 ClosePageIgnoringUnloadEvents(); | 1098 ClosePageIgnoringUnloadEvents(); |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1500 FrameTree* frame_tree = delegate_->GetFrameTree(); | 1497 FrameTree* frame_tree = delegate_->GetFrameTree(); |
1501 | 1498 |
1502 frame_tree->ResetForMainFrameSwap(); | 1499 frame_tree->ResetForMainFrameSwap(); |
1503 } | 1500 } |
1504 | 1501 |
1505 void RenderViewHostImpl::SelectWordAroundCaret() { | 1502 void RenderViewHostImpl::SelectWordAroundCaret() { |
1506 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); | 1503 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); |
1507 } | 1504 } |
1508 | 1505 |
1509 } // namespace content | 1506 } // namespace content |
OLD | NEW |