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 2750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2761 const LoadCommittedDetails& load_details) { | 2761 const LoadCommittedDetails& load_details) { |
2762 FOR_EACH_OBSERVER( | 2762 FOR_EACH_OBSERVER( |
2763 WebContentsObserver, observers_, NavigationEntryCommitted(load_details)); | 2763 WebContentsObserver, observers_, NavigationEntryCommitted(load_details)); |
2764 } | 2764 } |
2765 | 2765 |
2766 bool WebContentsImpl::OnMessageReceived(RenderFrameHost* render_frame_host, | 2766 bool WebContentsImpl::OnMessageReceived(RenderFrameHost* render_frame_host, |
2767 const IPC::Message& message) { | 2767 const IPC::Message& message) { |
2768 return OnMessageReceived(NULL, render_frame_host, message); | 2768 return OnMessageReceived(NULL, render_frame_host, message); |
2769 } | 2769 } |
2770 | 2770 |
2771 void WebContentsImpl::RenderFrameCreated(RenderFrameHost* render_frame_host) { | |
2772 // Note this is only for subframes, the notification for the main frame | |
2773 // happens in RenderViewCreated. | |
mmenke
2013/12/10 20:56:41
Shouldn't this comment be in the WebContentsObserv
jam
2013/12/10 21:14:17
I specifically avoided that because it's an implem
mmenke
2013/12/10 21:26:39
Sorry, I completely misunderstood the comment (I w
| |
2774 FOR_EACH_OBSERVER(WebContentsObserver, | |
2775 observers_, | |
2776 RenderFrameCreated(render_frame_host)); | |
2777 } | |
2778 | |
2779 void WebContentsImpl::RenderFrameDeleted(RenderFrameHost* render_frame_host) { | |
2780 FOR_EACH_OBSERVER(WebContentsObserver, | |
2781 observers_, | |
2782 RenderFrameDeleted(render_frame_host)); | |
2783 } | |
2784 | |
2771 RenderViewHostDelegateView* WebContentsImpl::GetDelegateView() { | 2785 RenderViewHostDelegateView* WebContentsImpl::GetDelegateView() { |
2772 return render_view_host_delegate_view_; | 2786 return render_view_host_delegate_view_; |
2773 } | 2787 } |
2774 | 2788 |
2775 RenderViewHostDelegate::RendererManagement* | 2789 RenderViewHostDelegate::RendererManagement* |
2776 WebContentsImpl::GetRendererManagementDelegate() { | 2790 WebContentsImpl::GetRendererManagementDelegate() { |
2777 return GetRenderManager(); | 2791 return GetRenderManager(); |
2778 } | 2792 } |
2779 | 2793 |
2780 RendererPreferences WebContentsImpl::GetRendererPrefs( | 2794 RendererPreferences WebContentsImpl::GetRendererPrefs( |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2821 if (entry && entry->IsViewSourceMode()) { | 2835 if (entry && entry->IsViewSourceMode()) { |
2822 // Put the renderer in view source mode. | 2836 // Put the renderer in view source mode. |
2823 render_view_host->Send( | 2837 render_view_host->Send( |
2824 new ViewMsg_EnableViewSourceMode(render_view_host->GetRoutingID())); | 2838 new ViewMsg_EnableViewSourceMode(render_view_host->GetRoutingID())); |
2825 } | 2839 } |
2826 | 2840 |
2827 view_->RenderViewCreated(render_view_host); | 2841 view_->RenderViewCreated(render_view_host); |
2828 | 2842 |
2829 FOR_EACH_OBSERVER( | 2843 FOR_EACH_OBSERVER( |
2830 WebContentsObserver, observers_, RenderViewCreated(render_view_host)); | 2844 WebContentsObserver, observers_, RenderViewCreated(render_view_host)); |
2845 | |
2846 // We tell the observers now instead of when the main RenderFrameHostImpl is | |
2847 // constructed because otherwise it would be too early (i.e. IPCs sent to the | |
2848 // frame would be dropped because it's not created yet). | |
2849 RenderFrameHost* main_frame = GetMainFrame(); | |
2850 FOR_EACH_OBSERVER( | |
2851 WebContentsObserver, observers_, RenderFrameCreated(main_frame)); | |
2831 } | 2852 } |
2832 | 2853 |
2833 void WebContentsImpl::RenderViewReady(RenderViewHost* rvh) { | 2854 void WebContentsImpl::RenderViewReady(RenderViewHost* rvh) { |
2834 if (rvh != GetRenderViewHost()) { | 2855 if (rvh != GetRenderViewHost()) { |
2835 // Don't notify the world, since this came from a renderer in the | 2856 // Don't notify the world, since this came from a renderer in the |
2836 // background. | 2857 // background. |
2837 return; | 2858 return; |
2838 } | 2859 } |
2839 | 2860 |
2840 notify_disconnection_ = true; | 2861 notify_disconnection_ = true; |
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3775 } | 3796 } |
3776 | 3797 |
3777 void WebContentsImpl::OnFrameRemoved( | 3798 void WebContentsImpl::OnFrameRemoved( |
3778 RenderViewHostImpl* render_view_host, | 3799 RenderViewHostImpl* render_view_host, |
3779 int64 frame_id) { | 3800 int64 frame_id) { |
3780 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 3801 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
3781 FrameDetached(render_view_host, frame_id)); | 3802 FrameDetached(render_view_host, frame_id)); |
3782 } | 3803 } |
3783 | 3804 |
3784 } // namespace content | 3805 } // namespace content |
OLD | NEW |