| 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/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1141 WebContents* WebContentsImpl::GetWebContents() { | 1141 WebContents* WebContentsImpl::GetWebContents() { |
| 1142 return this; | 1142 return this; |
| 1143 } | 1143 } |
| 1144 | 1144 |
| 1145 void WebContentsImpl::Init(const WebContents::CreateParams& params) { | 1145 void WebContentsImpl::Init(const WebContents::CreateParams& params) { |
| 1146 // This is set before initializing the render manager since | 1146 // This is set before initializing the render manager since |
| 1147 // RenderFrameHostManager::Init calls back into us via its delegate to ask if | 1147 // RenderFrameHostManager::Init calls back into us via its delegate to ask if |
| 1148 // it should be hidden. | 1148 // it should be hidden. |
| 1149 should_normally_be_visible_ = !params.initially_hidden; | 1149 should_normally_be_visible_ = !params.initially_hidden; |
| 1150 | 1150 |
| 1151 // Either both routing ids can be given, or neither can be. |
| 1152 DCHECK((params.routing_id == MSG_ROUTING_NONE && |
| 1153 params.main_frame_routing_id == MSG_ROUTING_NONE) || |
| 1154 (params.routing_id != MSG_ROUTING_NONE && |
| 1155 params.main_frame_routing_id != MSG_ROUTING_NONE)); |
| 1151 GetRenderManager()->Init( | 1156 GetRenderManager()->Init( |
| 1152 params.browser_context, params.site_instance, params.routing_id, | 1157 params.browser_context, params.site_instance, params.routing_id, |
| 1153 params.main_frame_routing_id); | 1158 params.main_frame_routing_id); |
| 1154 | 1159 |
| 1155 WebContentsViewDelegate* delegate = | 1160 WebContentsViewDelegate* delegate = |
| 1156 GetContentClient()->browser()->GetWebContentsViewDelegate(this); | 1161 GetContentClient()->browser()->GetWebContentsViewDelegate(this); |
| 1157 | 1162 |
| 1158 if (browser_plugin_guest_) { | 1163 if (browser_plugin_guest_) { |
| 1159 scoped_ptr<WebContentsView> platform_view(CreateWebContentsView( | 1164 scoped_ptr<WebContentsView> platform_view(CreateWebContentsView( |
| 1160 this, delegate, &render_view_host_delegate_view_)); | 1165 this, delegate, &render_view_host_delegate_view_)); |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1498 GetBrowserContext(), site_instance.get()); | 1503 GetBrowserContext(), site_instance.get()); |
| 1499 DOMStorageContextWrapper* dom_storage_context = | 1504 DOMStorageContextWrapper* dom_storage_context = |
| 1500 static_cast<DOMStorageContextWrapper*>(partition->GetDOMStorageContext()); | 1505 static_cast<DOMStorageContextWrapper*>(partition->GetDOMStorageContext()); |
| 1501 SessionStorageNamespaceImpl* session_storage_namespace_impl = | 1506 SessionStorageNamespaceImpl* session_storage_namespace_impl = |
| 1502 static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace); | 1507 static_cast<SessionStorageNamespaceImpl*>(session_storage_namespace); |
| 1503 CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context)); | 1508 CHECK(session_storage_namespace_impl->IsFromContext(dom_storage_context)); |
| 1504 | 1509 |
| 1505 if (delegate_ && | 1510 if (delegate_ && |
| 1506 !delegate_->ShouldCreateWebContents(this, | 1511 !delegate_->ShouldCreateWebContents(this, |
| 1507 route_id, | 1512 route_id, |
| 1513 main_frame_route_id, |
| 1508 params.window_container_type, | 1514 params.window_container_type, |
| 1509 params.frame_name, | 1515 params.frame_name, |
| 1510 params.target_url, | 1516 params.target_url, |
| 1511 partition_id, | 1517 partition_id, |
| 1512 session_storage_namespace)) { | 1518 session_storage_namespace)) { |
| 1513 if (route_id != MSG_ROUTING_NONE && | 1519 if (route_id != MSG_ROUTING_NONE && |
| 1514 !RenderViewHost::FromID(render_process_id, route_id)) { | 1520 !RenderViewHost::FromID(render_process_id, route_id)) { |
| 1515 // If the embedder didn't create a WebContents for this route, we need to | 1521 // If the embedder didn't create a WebContents for this route, we need to |
| 1516 // delete the RenderView that had already been created. | 1522 // delete the RenderView that had already been created. |
| 1517 Send(new ViewMsg_Close(route_id)); | 1523 Send(new ViewMsg_Close(route_id)); |
| (...skipping 2837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4355 node->render_manager()->ResumeResponseDeferredAtStart(); | 4361 node->render_manager()->ResumeResponseDeferredAtStart(); |
| 4356 } | 4362 } |
| 4357 | 4363 |
| 4358 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4364 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
| 4359 force_disable_overscroll_content_ = force_disable; | 4365 force_disable_overscroll_content_ = force_disable; |
| 4360 if (view_) | 4366 if (view_) |
| 4361 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4367 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
| 4362 } | 4368 } |
| 4363 | 4369 |
| 4364 } // namespace content | 4370 } // namespace content |
| OLD | NEW |