| 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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 return result; | 559 return result; |
| 560 } | 560 } |
| 561 | 561 |
| 562 // static | 562 // static |
| 563 WebContentsImpl* WebContentsImpl::FromFrameTreeNode( | 563 WebContentsImpl* WebContentsImpl::FromFrameTreeNode( |
| 564 FrameTreeNode* frame_tree_node) { | 564 FrameTreeNode* frame_tree_node) { |
| 565 return static_cast<WebContentsImpl*>( | 565 return static_cast<WebContentsImpl*>( |
| 566 WebContents::FromRenderFrameHost(frame_tree_node->current_frame_host())); | 566 WebContents::FromRenderFrameHost(frame_tree_node->current_frame_host())); |
| 567 } | 567 } |
| 568 | 568 |
| 569 // static |
| 570 WebContents* WebContentsImpl::FromRPHAndRFHIDs(int render_process_host_id, |
| 571 int render_frame_host_id) { |
| 572 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 573 RenderFrameHost* render_frame_host = |
| 574 RenderFrameHost::FromID(render_process_host_id, render_frame_host_id); |
| 575 if (!render_frame_host) |
| 576 return nullptr; |
| 577 |
| 578 return WebContents::FromRenderFrameHost(render_frame_host); |
| 579 } |
| 580 |
| 569 RenderFrameHostManager* WebContentsImpl::GetRenderManagerForTesting() { | 581 RenderFrameHostManager* WebContentsImpl::GetRenderManagerForTesting() { |
| 570 return GetRenderManager(); | 582 return GetRenderManager(); |
| 571 } | 583 } |
| 572 | 584 |
| 573 bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host, | 585 bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host, |
| 574 const IPC::Message& message) { | 586 const IPC::Message& message) { |
| 575 return OnMessageReceived(render_view_host, NULL, message); | 587 return OnMessageReceived(render_view_host, NULL, message); |
| 576 } | 588 } |
| 577 | 589 |
| 578 bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host, | 590 bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host, |
| (...skipping 4210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4789 return NULL; | 4801 return NULL; |
| 4790 } | 4802 } |
| 4791 | 4803 |
| 4792 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4804 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
| 4793 force_disable_overscroll_content_ = force_disable; | 4805 force_disable_overscroll_content_ = force_disable; |
| 4794 if (view_) | 4806 if (view_) |
| 4795 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4807 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
| 4796 } | 4808 } |
| 4797 | 4809 |
| 4798 } // namespace content | 4810 } // namespace content |
| OLD | NEW |