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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <utility> | 10 #include <utility> |
(...skipping 3788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3799 | 3799 |
3800 const GURL& WebContentsImpl::GetMainFrameLastCommittedURL() const { | 3800 const GURL& WebContentsImpl::GetMainFrameLastCommittedURL() const { |
3801 return GetLastCommittedURL(); | 3801 return GetLastCommittedURL(); |
3802 } | 3802 } |
3803 | 3803 |
3804 void WebContentsImpl::RenderFrameCreated(RenderFrameHost* render_frame_host) { | 3804 void WebContentsImpl::RenderFrameCreated(RenderFrameHost* render_frame_host) { |
3805 FOR_EACH_OBSERVER(WebContentsObserver, | 3805 FOR_EACH_OBSERVER(WebContentsObserver, |
3806 observers_, | 3806 observers_, |
3807 RenderFrameCreated(render_frame_host)); | 3807 RenderFrameCreated(render_frame_host)); |
3808 SetAccessibilityModeOnFrame(accessibility_mode_, render_frame_host); | 3808 SetAccessibilityModeOnFrame(accessibility_mode_, render_frame_host); |
| 3809 |
| 3810 if (!render_frame_host->IsRenderFrameLive() || render_frame_host->GetParent()) |
| 3811 return; |
| 3812 |
| 3813 NavigationEntry* entry = controller_.GetPendingEntry(); |
| 3814 if (entry && entry->IsViewSourceMode()) { |
| 3815 // Put the renderer in view source mode. |
| 3816 render_frame_host->Send( |
| 3817 new FrameMsg_EnableViewSourceMode(render_frame_host->GetRoutingID())); |
| 3818 } |
3809 } | 3819 } |
3810 | 3820 |
3811 void WebContentsImpl::RenderFrameDeleted(RenderFrameHost* render_frame_host) { | 3821 void WebContentsImpl::RenderFrameDeleted(RenderFrameHost* render_frame_host) { |
3812 FOR_EACH_OBSERVER(WebContentsObserver, | 3822 FOR_EACH_OBSERVER(WebContentsObserver, |
3813 observers_, | 3823 observers_, |
3814 RenderFrameDeleted(render_frame_host)); | 3824 RenderFrameDeleted(render_frame_host)); |
3815 } | 3825 } |
3816 | 3826 |
3817 void WebContentsImpl::ShowContextMenu(RenderFrameHost* render_frame_host, | 3827 void WebContentsImpl::ShowContextMenu(RenderFrameHost* render_frame_host, |
3818 const ContextMenuParams& params) { | 3828 const ContextMenuParams& params) { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3936 return; | 3946 return; |
3937 | 3947 |
3938 if (delegate_) | 3948 if (delegate_) |
3939 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 3949 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
3940 | 3950 |
3941 NotificationService::current()->Notify( | 3951 NotificationService::current()->Notify( |
3942 NOTIFICATION_WEB_CONTENTS_RENDER_VIEW_HOST_CREATED, | 3952 NOTIFICATION_WEB_CONTENTS_RENDER_VIEW_HOST_CREATED, |
3943 Source<WebContents>(this), | 3953 Source<WebContents>(this), |
3944 Details<RenderViewHost>(render_view_host)); | 3954 Details<RenderViewHost>(render_view_host)); |
3945 | 3955 |
3946 NavigationEntry* entry = controller_.GetPendingEntry(); | |
3947 if (entry && entry->IsViewSourceMode()) { | |
3948 // Put the renderer in view source mode. | |
3949 render_view_host->Send( | |
3950 new ViewMsg_EnableViewSourceMode(render_view_host->GetRoutingID())); | |
3951 } | |
3952 | |
3953 view_->RenderViewCreated(render_view_host); | 3956 view_->RenderViewCreated(render_view_host); |
3954 | 3957 |
3955 FOR_EACH_OBSERVER( | 3958 FOR_EACH_OBSERVER( |
3956 WebContentsObserver, observers_, RenderViewCreated(render_view_host)); | 3959 WebContentsObserver, observers_, RenderViewCreated(render_view_host)); |
3957 } | 3960 } |
3958 | 3961 |
3959 void WebContentsImpl::RenderViewReady(RenderViewHost* rvh) { | 3962 void WebContentsImpl::RenderViewReady(RenderViewHost* rvh) { |
3960 if (rvh != GetRenderViewHost()) { | 3963 if (rvh != GetRenderViewHost()) { |
3961 // Don't notify the world, since this came from a renderer in the | 3964 // Don't notify the world, since this came from a renderer in the |
3962 // background. | 3965 // background. |
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4822 else | 4825 else |
4823 WasHidden(); | 4826 WasHidden(); |
4824 } | 4827 } |
4825 | 4828 |
4826 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( | 4829 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( |
4827 JavaScriptDialogManager* dialog_manager) { | 4830 JavaScriptDialogManager* dialog_manager) { |
4828 dialog_manager_ = dialog_manager; | 4831 dialog_manager_ = dialog_manager; |
4829 } | 4832 } |
4830 | 4833 |
4831 } // namespace content | 4834 } // namespace content |
OLD | NEW |