| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 127 |
| 128 RenderViewHostImpl::RenderViewHostImpl(SiteInstance* instance, | 128 RenderViewHostImpl::RenderViewHostImpl(SiteInstance* instance, |
| 129 RenderViewHostDelegate* delegate, | 129 RenderViewHostDelegate* delegate, |
| 130 int routing_id, | 130 int routing_id, |
| 131 SessionStorageNamespace* session_storage) | 131 SessionStorageNamespace* session_storage) |
| 132 : RenderWidgetHostImpl(instance->GetProcess(), routing_id), | 132 : RenderWidgetHostImpl(instance->GetProcess(), routing_id), |
| 133 delegate_(delegate), | 133 delegate_(delegate), |
| 134 instance_(static_cast<SiteInstanceImpl*>(instance)), | 134 instance_(static_cast<SiteInstanceImpl*>(instance)), |
| 135 waiting_for_drag_context_response_(false), | 135 waiting_for_drag_context_response_(false), |
| 136 enabled_bindings_(0), | 136 enabled_bindings_(0), |
| 137 guest_(false), |
| 137 pending_request_id_(-1), | 138 pending_request_id_(-1), |
| 138 navigations_suspended_(false), | 139 navigations_suspended_(false), |
| 139 suspended_nav_message_(NULL), | 140 suspended_nav_message_(NULL), |
| 140 is_swapped_out_(false), | 141 is_swapped_out_(false), |
| 141 run_modal_reply_msg_(NULL), | 142 run_modal_reply_msg_(NULL), |
| 142 is_waiting_for_beforeunload_ack_(false), | 143 is_waiting_for_beforeunload_ack_(false), |
| 143 is_waiting_for_unload_ack_(false), | 144 is_waiting_for_unload_ack_(false), |
| 144 unload_ack_is_for_cross_site_transition_(false), | 145 unload_ack_is_for_cross_site_transition_(false), |
| 145 are_javascript_messages_suppressed_(false), | 146 are_javascript_messages_suppressed_(false), |
| 146 sudden_termination_allowed_(false), | 147 sudden_termination_allowed_(false), |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 GetView())->GetScreenInfo(¶ms.screen_info); | 236 GetView())->GetScreenInfo(¶ms.screen_info); |
| 236 } else { | 237 } else { |
| 237 content::RenderWidgetHostViewPort::GetDefaultScreenInfo( | 238 content::RenderWidgetHostViewPort::GetDefaultScreenInfo( |
| 238 ¶ms.screen_info); | 239 ¶ms.screen_info); |
| 239 } | 240 } |
| 240 #else | 241 #else |
| 241 params.screen_info = | 242 params.screen_info = |
| 242 WebKit::WebScreenInfoFactory::screenInfo( | 243 WebKit::WebScreenInfoFactory::screenInfo( |
| 243 gfx::NativeViewFromId(GetNativeViewId())); | 244 gfx::NativeViewFromId(GetNativeViewId())); |
| 244 #endif | 245 #endif |
| 246 params.guest = guest_; |
| 245 | 247 |
| 246 Send(new ViewMsg_New(params)); | 248 Send(new ViewMsg_New(params)); |
| 247 | 249 |
| 248 // If it's enabled, tell the renderer to set up the Javascript bindings for | 250 // If it's enabled, tell the renderer to set up the Javascript bindings for |
| 249 // sending messages back to the browser. | 251 // sending messages back to the browser. |
| 250 Send(new ViewMsg_AllowBindings(GetRoutingID(), enabled_bindings_)); | 252 Send(new ViewMsg_AllowBindings(GetRoutingID(), enabled_bindings_)); |
| 251 // Let our delegate know that we created a RenderView. | 253 // Let our delegate know that we created a RenderView. |
| 252 delegate_->RenderViewCreated(this); | 254 delegate_->RenderViewCreated(this); |
| 253 | 255 |
| 254 // Invert the color scheme if the operating system's color scheme is | 256 // Invert the color scheme if the operating system's color scheme is |
| (...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1478 // later. | 1480 // later. |
| 1479 VLOG(1) << "Blocked URL " << url->spec(); | 1481 VLOG(1) << "Blocked URL " << url->spec(); |
| 1480 *url = GURL(); | 1482 *url = GURL(); |
| 1481 } | 1483 } |
| 1482 } | 1484 } |
| 1483 | 1485 |
| 1484 void RenderViewHostImpl::SetAltErrorPageURL(const GURL& url) { | 1486 void RenderViewHostImpl::SetAltErrorPageURL(const GURL& url) { |
| 1485 Send(new ViewMsg_SetAltErrorPageURL(GetRoutingID(), url)); | 1487 Send(new ViewMsg_SetAltErrorPageURL(GetRoutingID(), url)); |
| 1486 } | 1488 } |
| 1487 | 1489 |
| 1490 void RenderViewHostImpl::SetGuest(bool guest) { |
| 1491 guest_ = guest; |
| 1492 } |
| 1493 |
| 1488 void RenderViewHostImpl::ExitFullscreen() { | 1494 void RenderViewHostImpl::ExitFullscreen() { |
| 1489 RejectMouseLockOrUnlockIfNecessary(); | 1495 RejectMouseLockOrUnlockIfNecessary(); |
| 1490 } | 1496 } |
| 1491 | 1497 |
| 1492 void RenderViewHostImpl::UpdateWebkitPreferences(const WebPreferences& prefs) { | 1498 void RenderViewHostImpl::UpdateWebkitPreferences(const WebPreferences& prefs) { |
| 1493 Send(new ViewMsg_UpdateWebPreferences(GetRoutingID(), prefs)); | 1499 Send(new ViewMsg_UpdateWebPreferences(GetRoutingID(), prefs)); |
| 1494 } | 1500 } |
| 1495 | 1501 |
| 1496 void RenderViewHostImpl::ClearFocusedNode() { | 1502 void RenderViewHostImpl::ClearFocusedNode() { |
| 1497 Send(new ViewMsg_ClearFocusedNode(GetRoutingID())); | 1503 Send(new ViewMsg_ClearFocusedNode(GetRoutingID())); |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1732 // can cause navigations to be ignored in OnMsgNavigate. | 1738 // can cause navigations to be ignored in OnMsgNavigate. |
| 1733 is_waiting_for_beforeunload_ack_ = false; | 1739 is_waiting_for_beforeunload_ack_ = false; |
| 1734 is_waiting_for_unload_ack_ = false; | 1740 is_waiting_for_unload_ack_ = false; |
| 1735 } | 1741 } |
| 1736 | 1742 |
| 1737 void RenderViewHostImpl::ClearPowerSaveBlockers() { | 1743 void RenderViewHostImpl::ClearPowerSaveBlockers() { |
| 1738 STLDeleteValues(&power_save_blockers_); | 1744 STLDeleteValues(&power_save_blockers_); |
| 1739 } | 1745 } |
| 1740 | 1746 |
| 1741 } // namespace content | 1747 } // namespace content |
| OLD | NEW |