| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 126 |
| 127 RenderViewHostImpl::RenderViewHostImpl(SiteInstance* instance, | 127 RenderViewHostImpl::RenderViewHostImpl(SiteInstance* instance, |
| 128 RenderViewHostDelegate* delegate, | 128 RenderViewHostDelegate* delegate, |
| 129 int routing_id, | 129 int routing_id, |
| 130 SessionStorageNamespace* session_storage) | 130 SessionStorageNamespace* session_storage) |
| 131 : RenderWidgetHostImpl(instance->GetProcess(), routing_id), | 131 : RenderWidgetHostImpl(instance->GetProcess(), routing_id), |
| 132 delegate_(delegate), | 132 delegate_(delegate), |
| 133 instance_(static_cast<SiteInstanceImpl*>(instance)), | 133 instance_(static_cast<SiteInstanceImpl*>(instance)), |
| 134 waiting_for_drag_context_response_(false), | 134 waiting_for_drag_context_response_(false), |
| 135 enabled_bindings_(0), | 135 enabled_bindings_(0), |
| 136 hosts_guest_(false), |
| 136 pending_request_id_(-1), | 137 pending_request_id_(-1), |
| 137 navigations_suspended_(false), | 138 navigations_suspended_(false), |
| 138 suspended_nav_message_(NULL), | 139 suspended_nav_message_(NULL), |
| 139 is_swapped_out_(false), | 140 is_swapped_out_(false), |
| 140 run_modal_reply_msg_(NULL), | 141 run_modal_reply_msg_(NULL), |
| 141 is_waiting_for_beforeunload_ack_(false), | 142 is_waiting_for_beforeunload_ack_(false), |
| 142 is_waiting_for_unload_ack_(false), | 143 is_waiting_for_unload_ack_(false), |
| 143 unload_ack_is_for_cross_site_transition_(false), | 144 unload_ack_is_for_cross_site_transition_(false), |
| 144 are_javascript_messages_suppressed_(false), | 145 are_javascript_messages_suppressed_(false), |
| 145 sudden_termination_allowed_(false), | 146 sudden_termination_allowed_(false), |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 GetView())->GetScreenInfo(¶ms.screen_info); | 235 GetView())->GetScreenInfo(¶ms.screen_info); |
| 235 } else { | 236 } else { |
| 236 content::RenderWidgetHostViewPort::GetDefaultScreenInfo( | 237 content::RenderWidgetHostViewPort::GetDefaultScreenInfo( |
| 237 ¶ms.screen_info); | 238 ¶ms.screen_info); |
| 238 } | 239 } |
| 239 #else | 240 #else |
| 240 params.screen_info = | 241 params.screen_info = |
| 241 WebKit::WebScreenInfoFactory::screenInfo( | 242 WebKit::WebScreenInfoFactory::screenInfo( |
| 242 gfx::NativeViewFromId(GetNativeViewId())); | 243 gfx::NativeViewFromId(GetNativeViewId())); |
| 243 #endif | 244 #endif |
| 244 | 245 params.guest = hosts_guest_; |
| 245 Send(new ViewMsg_New(params)); | 246 Send(new ViewMsg_New(params)); |
| 246 | 247 |
| 247 // If it's enabled, tell the renderer to set up the Javascript bindings for | 248 // If it's enabled, tell the renderer to set up the Javascript bindings for |
| 248 // sending messages back to the browser. | 249 // sending messages back to the browser. |
| 249 Send(new ViewMsg_AllowBindings(GetRoutingID(), enabled_bindings_)); | 250 Send(new ViewMsg_AllowBindings(GetRoutingID(), enabled_bindings_)); |
| 250 // Let our delegate know that we created a RenderView. | 251 // Let our delegate know that we created a RenderView. |
| 251 delegate_->RenderViewCreated(this); | 252 delegate_->RenderViewCreated(this); |
| 252 | 253 |
| 253 // Invert the color scheme if a flag was set. | 254 // Invert the color scheme if a flag was set. |
| 254 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInvertWebContent)) | 255 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInvertWebContent)) |
| (...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1448 // later. | 1449 // later. |
| 1449 VLOG(1) << "Blocked URL " << url->spec(); | 1450 VLOG(1) << "Blocked URL " << url->spec(); |
| 1450 *url = GURL(); | 1451 *url = GURL(); |
| 1451 } | 1452 } |
| 1452 } | 1453 } |
| 1453 | 1454 |
| 1454 void RenderViewHostImpl::SetAltErrorPageURL(const GURL& url) { | 1455 void RenderViewHostImpl::SetAltErrorPageURL(const GURL& url) { |
| 1455 Send(new ViewMsg_SetAltErrorPageURL(GetRoutingID(), url)); | 1456 Send(new ViewMsg_SetAltErrorPageURL(GetRoutingID(), url)); |
| 1456 } | 1457 } |
| 1457 | 1458 |
| 1459 void RenderViewHostImpl::SetHostsGuest(bool hosts_guest) { |
| 1460 hosts_guest_ = hosts_guest; |
| 1461 } |
| 1462 |
| 1458 void RenderViewHostImpl::ExitFullscreen() { | 1463 void RenderViewHostImpl::ExitFullscreen() { |
| 1459 RejectMouseLockOrUnlockIfNecessary(); | 1464 RejectMouseLockOrUnlockIfNecessary(); |
| 1460 } | 1465 } |
| 1461 | 1466 |
| 1462 void RenderViewHostImpl::UpdateWebkitPreferences(const WebPreferences& prefs) { | 1467 void RenderViewHostImpl::UpdateWebkitPreferences(const WebPreferences& prefs) { |
| 1463 Send(new ViewMsg_UpdateWebPreferences(GetRoutingID(), prefs)); | 1468 Send(new ViewMsg_UpdateWebPreferences(GetRoutingID(), prefs)); |
| 1464 } | 1469 } |
| 1465 | 1470 |
| 1466 void RenderViewHostImpl::ClearFocusedNode() { | 1471 void RenderViewHostImpl::ClearFocusedNode() { |
| 1467 Send(new ViewMsg_ClearFocusedNode(GetRoutingID())); | 1472 Send(new ViewMsg_ClearFocusedNode(GetRoutingID())); |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1702 // can cause navigations to be ignored in OnMsgNavigate. | 1707 // can cause navigations to be ignored in OnMsgNavigate. |
| 1703 is_waiting_for_beforeunload_ack_ = false; | 1708 is_waiting_for_beforeunload_ack_ = false; |
| 1704 is_waiting_for_unload_ack_ = false; | 1709 is_waiting_for_unload_ack_ = false; |
| 1705 } | 1710 } |
| 1706 | 1711 |
| 1707 void RenderViewHostImpl::ClearPowerSaveBlockers() { | 1712 void RenderViewHostImpl::ClearPowerSaveBlockers() { |
| 1708 STLDeleteValues(&power_save_blockers_); | 1713 STLDeleteValues(&power_save_blockers_); |
| 1709 } | 1714 } |
| 1710 | 1715 |
| 1711 } // namespace content | 1716 } // namespace content |
| OLD | NEW |