| 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/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 should_normally_be_visible_ = !params.initially_hidden; | 1197 should_normally_be_visible_ = !params.initially_hidden; |
| 1198 | 1198 |
| 1199 // Either both routing ids can be given, or neither can be. | 1199 // Either both routing ids can be given, or neither can be. |
| 1200 DCHECK((params.routing_id == MSG_ROUTING_NONE && | 1200 DCHECK((params.routing_id == MSG_ROUTING_NONE && |
| 1201 params.main_frame_routing_id == MSG_ROUTING_NONE) || | 1201 params.main_frame_routing_id == MSG_ROUTING_NONE) || |
| 1202 (params.routing_id != MSG_ROUTING_NONE && | 1202 (params.routing_id != MSG_ROUTING_NONE && |
| 1203 params.main_frame_routing_id != MSG_ROUTING_NONE)); | 1203 params.main_frame_routing_id != MSG_ROUTING_NONE)); |
| 1204 GetRenderManager()->Init( | 1204 GetRenderManager()->Init( |
| 1205 params.browser_context, params.site_instance, params.routing_id, | 1205 params.browser_context, params.site_instance, params.routing_id, |
| 1206 params.main_frame_routing_id); | 1206 params.main_frame_routing_id); |
| 1207 frame_tree_.root()->SetFrameName(params.main_frame_name); |
| 1207 | 1208 |
| 1208 WebContentsViewDelegate* delegate = | 1209 WebContentsViewDelegate* delegate = |
| 1209 GetContentClient()->browser()->GetWebContentsViewDelegate(this); | 1210 GetContentClient()->browser()->GetWebContentsViewDelegate(this); |
| 1210 | 1211 |
| 1211 if (browser_plugin_guest_) { | 1212 if (browser_plugin_guest_) { |
| 1212 scoped_ptr<WebContentsView> platform_view(CreateWebContentsView( | 1213 scoped_ptr<WebContentsView> platform_view(CreateWebContentsView( |
| 1213 this, delegate, &render_view_host_delegate_view_)); | 1214 this, delegate, &render_view_host_delegate_view_)); |
| 1214 | 1215 |
| 1215 WebContentsViewGuest* rv = new WebContentsViewGuest( | 1216 WebContentsViewGuest* rv = new WebContentsViewGuest( |
| 1216 this, browser_plugin_guest_.get(), platform_view.Pass(), | 1217 this, browser_plugin_guest_.get(), platform_view.Pass(), |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1575 GetRenderViewHost()->GetProcess()->ResumeRequestsForView( | 1576 GetRenderViewHost()->GetProcess()->ResumeRequestsForView( |
| 1576 main_frame_route_id); | 1577 main_frame_route_id); |
| 1577 return; | 1578 return; |
| 1578 } | 1579 } |
| 1579 | 1580 |
| 1580 // Create the new web contents. This will automatically create the new | 1581 // Create the new web contents. This will automatically create the new |
| 1581 // WebContentsView. In the future, we may want to create the view separately. | 1582 // WebContentsView. In the future, we may want to create the view separately. |
| 1582 CreateParams create_params(GetBrowserContext(), site_instance.get()); | 1583 CreateParams create_params(GetBrowserContext(), site_instance.get()); |
| 1583 create_params.routing_id = route_id; | 1584 create_params.routing_id = route_id; |
| 1584 create_params.main_frame_routing_id = main_frame_route_id; | 1585 create_params.main_frame_routing_id = main_frame_route_id; |
| 1586 create_params.main_frame_name = base::UTF16ToUTF8(params.frame_name); |
| 1585 create_params.opener = this; | 1587 create_params.opener = this; |
| 1586 create_params.opener_suppressed = params.opener_suppressed; | 1588 create_params.opener_suppressed = params.opener_suppressed; |
| 1587 if (params.disposition == NEW_BACKGROUND_TAB) | 1589 if (params.disposition == NEW_BACKGROUND_TAB) |
| 1588 create_params.initially_hidden = true; | 1590 create_params.initially_hidden = true; |
| 1589 create_params.renderer_initiated_creation = true; | 1591 create_params.renderer_initiated_creation = true; |
| 1590 | 1592 |
| 1591 WebContentsImpl* new_contents = NULL; | 1593 WebContentsImpl* new_contents = NULL; |
| 1592 if (!is_guest) { | 1594 if (!is_guest) { |
| 1593 create_params.context = view_->GetNativeView(); | 1595 create_params.context = view_->GetNativeView(); |
| 1594 create_params.initial_size = GetContainerBounds().size(); | 1596 create_params.initial_size = GetContainerBounds().size(); |
| (...skipping 2834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4429 node->render_manager()->ResumeResponseDeferredAtStart(); | 4431 node->render_manager()->ResumeResponseDeferredAtStart(); |
| 4430 } | 4432 } |
| 4431 | 4433 |
| 4432 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4434 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
| 4433 force_disable_overscroll_content_ = force_disable; | 4435 force_disable_overscroll_content_ = force_disable; |
| 4434 if (view_) | 4436 if (view_) |
| 4435 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4437 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
| 4436 } | 4438 } |
| 4437 | 4439 |
| 4438 } // namespace content | 4440 } // namespace content |
| OLD | NEW |