Chromium Code Reviews| 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 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 638 RenderProcessHost* WebContentsImpl::GetRenderProcessHost() const { | 638 RenderProcessHost* WebContentsImpl::GetRenderProcessHost() const { |
| 639 RenderViewHostImpl* host = GetRenderManager()->current_host(); | 639 RenderViewHostImpl* host = GetRenderManager()->current_host(); |
| 640 return host ? host->GetProcess() : NULL; | 640 return host ? host->GetProcess() : NULL; |
| 641 } | 641 } |
| 642 | 642 |
| 643 RenderFrameHostImpl* WebContentsImpl::GetMainFrame() { | 643 RenderFrameHostImpl* WebContentsImpl::GetMainFrame() { |
| 644 return frame_tree_.root()->current_frame_host(); | 644 return frame_tree_.root()->current_frame_host(); |
| 645 } | 645 } |
| 646 | 646 |
| 647 RenderFrameHost* WebContentsImpl::GetFocusedFrame() { | 647 RenderFrameHost* WebContentsImpl::GetFocusedFrame() { |
| 648 if (ShowingInterstitialPage()) { | |
| 649 InterstitialPageImpl* interstitial_page = | |
| 650 static_cast<InterstitialPageImpl*>(GetInterstitialPage()); | |
| 651 return interstitial_page->GetMainFrame(); | |
|
Charlie Reis
2015/04/27 23:39:26
This is mildly scary to me. We're returning a fra
| |
| 652 } | |
| 648 if (!frame_tree_.GetFocusedFrame()) | 653 if (!frame_tree_.GetFocusedFrame()) |
| 649 return NULL; | 654 return NULL; |
| 650 return frame_tree_.GetFocusedFrame()->current_frame_host(); | 655 return frame_tree_.GetFocusedFrame()->current_frame_host(); |
| 651 } | 656 } |
| 652 | 657 |
| 653 void WebContentsImpl::ForEachFrame( | 658 void WebContentsImpl::ForEachFrame( |
| 654 const base::Callback<void(RenderFrameHost*)>& on_frame) { | 659 const base::Callback<void(RenderFrameHost*)>& on_frame) { |
| 655 frame_tree_.ForEach(base::Bind(&ForEachFrameInternal, on_frame)); | 660 frame_tree_.ForEach(base::Bind(&ForEachFrameInternal, on_frame)); |
| 656 } | 661 } |
| 657 | 662 |
| (...skipping 3765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4423 node->render_manager()->ResumeResponseDeferredAtStart(); | 4428 node->render_manager()->ResumeResponseDeferredAtStart(); |
| 4424 } | 4429 } |
| 4425 | 4430 |
| 4426 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4431 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
| 4427 force_disable_overscroll_content_ = force_disable; | 4432 force_disable_overscroll_content_ = force_disable; |
| 4428 if (view_) | 4433 if (view_) |
| 4429 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4434 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
| 4430 } | 4435 } |
| 4431 | 4436 |
| 4432 } // namespace content | 4437 } // namespace content |
| OLD | NEW |