| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 if (!widget || !widget->IsRenderView()) | 192 if (!widget || !widget->IsRenderView()) |
| 193 return NULL; | 193 return NULL; |
| 194 return static_cast<RenderViewHostImpl*>(RenderWidgetHostImpl::From(widget)); | 194 return static_cast<RenderViewHostImpl*>(RenderWidgetHostImpl::From(widget)); |
| 195 } | 195 } |
| 196 | 196 |
| 197 RenderViewHostImpl::RenderViewHostImpl( | 197 RenderViewHostImpl::RenderViewHostImpl( |
| 198 SiteInstance* instance, | 198 SiteInstance* instance, |
| 199 RenderViewHostDelegate* delegate, | 199 RenderViewHostDelegate* delegate, |
| 200 RenderWidgetHostDelegate* widget_delegate, | 200 RenderWidgetHostDelegate* widget_delegate, |
| 201 int32 routing_id, | 201 int32 routing_id, |
| 202 int32 surface_id, | |
| 203 int32 main_frame_routing_id, | 202 int32 main_frame_routing_id, |
| 204 bool swapped_out, | 203 bool swapped_out, |
| 205 bool hidden, | 204 bool hidden, |
| 206 bool has_initialized_audio_host) | 205 bool has_initialized_audio_host) |
| 207 : RenderWidgetHostImpl(widget_delegate, | 206 : RenderWidgetHostImpl(widget_delegate, |
| 208 instance->GetProcess(), | 207 instance->GetProcess(), |
| 209 routing_id, | 208 routing_id, |
| 210 surface_id, | |
| 211 hidden), | 209 hidden), |
| 212 frames_ref_count_(0), | 210 frames_ref_count_(0), |
| 213 delegate_(delegate), | 211 delegate_(delegate), |
| 214 instance_(static_cast<SiteInstanceImpl*>(instance)), | 212 instance_(static_cast<SiteInstanceImpl*>(instance)), |
| 215 waiting_for_drag_context_response_(false), | 213 waiting_for_drag_context_response_(false), |
| 216 enabled_bindings_(0), | 214 enabled_bindings_(0), |
| 217 page_id_(-1), | 215 page_id_(-1), |
| 218 nav_entry_id_(0), | 216 nav_entry_id_(0), |
| 219 is_active_(!swapped_out), | 217 is_active_(!swapped_out), |
| 220 is_pending_deletion_(false), | 218 is_pending_deletion_(false), |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 | 303 |
| 306 ViewMsg_New_Params params; | 304 ViewMsg_New_Params params; |
| 307 params.renderer_preferences = | 305 params.renderer_preferences = |
| 308 delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext()); | 306 delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext()); |
| 309 #if defined(OS_WIN) | 307 #if defined(OS_WIN) |
| 310 GetWindowsSpecificPrefs(¶ms.renderer_preferences); | 308 GetWindowsSpecificPrefs(¶ms.renderer_preferences); |
| 311 #endif | 309 #endif |
| 312 params.web_preferences = GetWebkitPreferences(); | 310 params.web_preferences = GetWebkitPreferences(); |
| 313 params.view_id = GetRoutingID(); | 311 params.view_id = GetRoutingID(); |
| 314 params.main_frame_routing_id = main_frame_routing_id_; | 312 params.main_frame_routing_id = main_frame_routing_id_; |
| 315 params.surface_id = surface_id(); | |
| 316 params.session_storage_namespace_id = | 313 params.session_storage_namespace_id = |
| 317 delegate_->GetSessionStorageNamespace(instance_.get())->id(); | 314 delegate_->GetSessionStorageNamespace(instance_.get())->id(); |
| 318 // Ensure the RenderView sets its opener correctly. | 315 // Ensure the RenderView sets its opener correctly. |
| 319 params.opener_frame_route_id = opener_frame_route_id; | 316 params.opener_frame_route_id = opener_frame_route_id; |
| 320 params.swapped_out = !is_active_; | 317 params.swapped_out = !is_active_; |
| 321 params.replicated_frame_state = replicated_frame_state; | 318 params.replicated_frame_state = replicated_frame_state; |
| 322 params.proxy_routing_id = proxy_route_id; | 319 params.proxy_routing_id = proxy_route_id; |
| 323 params.hidden = is_hidden(); | 320 params.hidden = is_hidden(); |
| 324 params.never_visible = delegate_->IsNeverVisible(); | 321 params.never_visible = delegate_->IsNeverVisible(); |
| 325 params.window_was_created_with_opener = window_was_created_with_opener; | 322 params.window_was_created_with_opener = window_was_created_with_opener; |
| (...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 985 ViewHostMsg_CreateWindow_Params validated_params(params); | 982 ViewHostMsg_CreateWindow_Params validated_params(params); |
| 986 GetProcess()->FilterURL(false, &validated_params.target_url); | 983 GetProcess()->FilterURL(false, &validated_params.target_url); |
| 987 GetProcess()->FilterURL(false, &validated_params.opener_url); | 984 GetProcess()->FilterURL(false, &validated_params.opener_url); |
| 988 GetProcess()->FilterURL(true, &validated_params.opener_security_origin); | 985 GetProcess()->FilterURL(true, &validated_params.opener_security_origin); |
| 989 | 986 |
| 990 delegate_->CreateNewWindow(GetSiteInstance(), route_id, main_frame_route_id, | 987 delegate_->CreateNewWindow(GetSiteInstance(), route_id, main_frame_route_id, |
| 991 validated_params, session_storage_namespace); | 988 validated_params, session_storage_namespace); |
| 992 } | 989 } |
| 993 | 990 |
| 994 void RenderViewHostImpl::CreateNewWidget(int32 route_id, | 991 void RenderViewHostImpl::CreateNewWidget(int32 route_id, |
| 995 int32 surface_id, | |
| 996 blink::WebPopupType popup_type) { | 992 blink::WebPopupType popup_type) { |
| 997 delegate_->CreateNewWidget(GetProcess()->GetID(), route_id, surface_id, | 993 delegate_->CreateNewWidget(GetProcess()->GetID(), route_id, popup_type); |
| 998 popup_type); | |
| 999 } | 994 } |
| 1000 | 995 |
| 1001 void RenderViewHostImpl::CreateNewFullscreenWidget(int32 route_id, | 996 void RenderViewHostImpl::CreateNewFullscreenWidget(int32 route_id) { |
| 1002 int32 surface_id) { | 997 delegate_->CreateNewFullscreenWidget(GetProcess()->GetID(), route_id); |
| 1003 delegate_->CreateNewFullscreenWidget(GetProcess()->GetID(), route_id, | |
| 1004 surface_id); | |
| 1005 } | 998 } |
| 1006 | 999 |
| 1007 void RenderViewHostImpl::OnShowView(int route_id, | 1000 void RenderViewHostImpl::OnShowView(int route_id, |
| 1008 WindowOpenDisposition disposition, | 1001 WindowOpenDisposition disposition, |
| 1009 const gfx::Rect& initial_rect, | 1002 const gfx::Rect& initial_rect, |
| 1010 bool user_gesture) { | 1003 bool user_gesture) { |
| 1011 delegate_->ShowCreatedWindow(route_id, disposition, initial_rect, | 1004 delegate_->ShowCreatedWindow(route_id, disposition, initial_rect, |
| 1012 user_gesture); | 1005 user_gesture); |
| 1013 Send(new ViewMsg_Move_ACK(route_id)); | 1006 Send(new ViewMsg_Move_ACK(route_id)); |
| 1014 } | 1007 } |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1424 if (!policy->CanReadFile(GetProcess()->GetID(), file)) | 1417 if (!policy->CanReadFile(GetProcess()->GetID(), file)) |
| 1425 policy->GrantReadFile(GetProcess()->GetID(), file); | 1418 policy->GrantReadFile(GetProcess()->GetID(), file); |
| 1426 } | 1419 } |
| 1427 } | 1420 } |
| 1428 | 1421 |
| 1429 void RenderViewHostImpl::SelectWordAroundCaret() { | 1422 void RenderViewHostImpl::SelectWordAroundCaret() { |
| 1430 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); | 1423 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); |
| 1431 } | 1424 } |
| 1432 | 1425 |
| 1433 } // namespace content | 1426 } // namespace content |
| OLD | NEW |