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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 if (view_) | 600 if (view_) |
601 view_->SetOverscrollControllerEnabled(delegate->CanOverscrollContent()); | 601 view_->SetOverscrollControllerEnabled(delegate->CanOverscrollContent()); |
602 } | 602 } |
603 } | 603 } |
604 | 604 |
605 RenderProcessHost* WebContentsImpl::GetRenderProcessHost() const { | 605 RenderProcessHost* WebContentsImpl::GetRenderProcessHost() const { |
606 RenderViewHostImpl* host = GetRenderManager()->current_host(); | 606 RenderViewHostImpl* host = GetRenderManager()->current_host(); |
607 return host ? host->GetProcess() : NULL; | 607 return host ? host->GetProcess() : NULL; |
608 } | 608 } |
609 | 609 |
| 610 RenderFrameHost* WebContentsImpl::GetMainFrame() { |
| 611 return frame_tree_.root()->render_frame_host(); |
| 612 } |
| 613 |
610 RenderViewHost* WebContentsImpl::GetRenderViewHost() const { | 614 RenderViewHost* WebContentsImpl::GetRenderViewHost() const { |
611 return GetRenderManager()->current_host(); | 615 return GetRenderManager()->current_host(); |
612 } | 616 } |
613 | 617 |
614 void WebContentsImpl::GetRenderViewHostAtPosition( | 618 void WebContentsImpl::GetRenderViewHostAtPosition( |
615 int x, | 619 int x, |
616 int y, | 620 int y, |
617 const base::Callback<void(RenderViewHost*, int, int)>& callback) { | 621 const base::Callback<void(RenderViewHost*, int, int)>& callback) { |
618 BrowserPluginEmbedder* embedder = GetBrowserPluginEmbedder(); | 622 BrowserPluginEmbedder* embedder = GetBrowserPluginEmbedder(); |
619 if (embedder) | 623 if (embedder) |
(...skipping 3112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3732 } | 3736 } |
3733 | 3737 |
3734 void WebContentsImpl::OnFrameRemoved( | 3738 void WebContentsImpl::OnFrameRemoved( |
3735 RenderViewHostImpl* render_view_host, | 3739 RenderViewHostImpl* render_view_host, |
3736 int64 frame_id) { | 3740 int64 frame_id) { |
3737 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 3741 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
3738 FrameDetached(render_view_host, frame_id)); | 3742 FrameDetached(render_view_host, frame_id)); |
3739 } | 3743 } |
3740 | 3744 |
3741 } // namespace content | 3745 } // namespace content |
OLD | NEW |