| 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/crash_logging.h" | 10 #include "base/debug/crash_logging.h" |
| (...skipping 3942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3953 // TODO(nasko): Investigate how to remove the GetActiveEntry usage here, | 3953 // TODO(nasko): Investigate how to remove the GetActiveEntry usage here, |
| 3954 // as it is deprecated and can be out of sync with GetRenderViewHost(). | 3954 // as it is deprecated and can be out of sync with GetRenderViewHost(). |
| 3955 GURL url = controller_.GetActiveEntry() | 3955 GURL url = controller_.GetActiveEntry() |
| 3956 ? controller_.GetActiveEntry()->GetURL() : GURL::EmptyGURL(); | 3956 ? controller_.GetActiveEntry()->GetURL() : GURL::EmptyGURL(); |
| 3957 | 3957 |
| 3958 return GetRenderManager()->current_host()->ComputeWebkitPrefs(url); | 3958 return GetRenderManager()->current_host()->ComputeWebkitPrefs(url); |
| 3959 } | 3959 } |
| 3960 | 3960 |
| 3961 int WebContentsImpl::CreateSwappedOutRenderView( | 3961 int WebContentsImpl::CreateSwappedOutRenderView( |
| 3962 SiteInstance* instance) { | 3962 SiteInstance* instance) { |
| 3963 return GetRenderManager()->CreateRenderFrame( | 3963 return GetRenderManager()->CreateRenderFrame(instance, |
| 3964 instance, MSG_ROUTING_NONE, true, true, true); | 3964 MSG_ROUTING_NONE, SWAPPED_OUT | FOR_MAIN_FRAME_NAVIGATION | HIDDEN); |
| 3965 } | 3965 } |
| 3966 | 3966 |
| 3967 void WebContentsImpl::OnUserGesture() { | 3967 void WebContentsImpl::OnUserGesture() { |
| 3968 // Notify observers. | 3968 // Notify observers. |
| 3969 FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidGetUserGesture()); | 3969 FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidGetUserGesture()); |
| 3970 | 3970 |
| 3971 ResourceDispatcherHostImpl* rdh = ResourceDispatcherHostImpl::Get(); | 3971 ResourceDispatcherHostImpl* rdh = ResourceDispatcherHostImpl::Get(); |
| 3972 if (rdh) // NULL in unittests. | 3972 if (rdh) // NULL in unittests. |
| 3973 rdh->OnUserGesture(this); | 3973 rdh->OnUserGesture(this); |
| 3974 } | 3974 } |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4126 instance) | 4126 instance) |
| 4127 return GetRenderManager()->pending_render_view_host()->GetRoutingID(); | 4127 return GetRenderManager()->pending_render_view_host()->GetRoutingID(); |
| 4128 | 4128 |
| 4129 RenderViewHostImpl* rvh = GetRenderManager()->GetSwappedOutRenderViewHost( | 4129 RenderViewHostImpl* rvh = GetRenderManager()->GetSwappedOutRenderViewHost( |
| 4130 instance); | 4130 instance); |
| 4131 if (rvh) | 4131 if (rvh) |
| 4132 return rvh->GetRoutingID(); | 4132 return rvh->GetRoutingID(); |
| 4133 | 4133 |
| 4134 // Create a swapped out RenderView in the given SiteInstance if none exists, | 4134 // Create a swapped out RenderView in the given SiteInstance if none exists, |
| 4135 // setting its opener to the given route_id. Return the new view's route_id. | 4135 // setting its opener to the given route_id. Return the new view's route_id. |
| 4136 return GetRenderManager()->CreateRenderFrame( | 4136 return GetRenderManager()->CreateRenderFrame(instance, |
| 4137 instance, opener_route_id, true, true, true); | 4137 opener_route_id, SWAPPED_OUT | FOR_MAIN_FRAME_NAVIGATION | HIDDEN); |
| 4138 } | 4138 } |
| 4139 | 4139 |
| 4140 NavigationControllerImpl& WebContentsImpl::GetControllerForRenderManager() { | 4140 NavigationControllerImpl& WebContentsImpl::GetControllerForRenderManager() { |
| 4141 return GetController(); | 4141 return GetController(); |
| 4142 } | 4142 } |
| 4143 | 4143 |
| 4144 WebUIImpl* WebContentsImpl::CreateWebUIForRenderManager(const GURL& url) { | 4144 WebUIImpl* WebContentsImpl::CreateWebUIForRenderManager(const GURL& url) { |
| 4145 return static_cast<WebUIImpl*>(CreateWebUI(url)); | 4145 return static_cast<WebUIImpl*>(CreateWebUI(url)); |
| 4146 } | 4146 } |
| 4147 | 4147 |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4408 node->render_manager()->ResumeResponseDeferredAtStart(); | 4408 node->render_manager()->ResumeResponseDeferredAtStart(); |
| 4409 } | 4409 } |
| 4410 | 4410 |
| 4411 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4411 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
| 4412 force_disable_overscroll_content_ = force_disable; | 4412 force_disable_overscroll_content_ = force_disable; |
| 4413 if (view_) | 4413 if (view_) |
| 4414 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4414 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
| 4415 } | 4415 } |
| 4416 | 4416 |
| 4417 } // namespace content | 4417 } // namespace content |
| OLD | NEW |