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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 IPC_MESSAGE_HANDLER(FrameHostMsg_MediaPausedNotification, | 617 IPC_MESSAGE_HANDLER(FrameHostMsg_MediaPausedNotification, |
618 OnMediaPausedNotification) | 618 OnMediaPausedNotification) |
619 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFirstVisuallyNonEmptyPaint, | 619 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFirstVisuallyNonEmptyPaint, |
620 OnFirstVisuallyNonEmptyPaint) | 620 OnFirstVisuallyNonEmptyPaint) |
621 IPC_MESSAGE_HANDLER(FrameHostMsg_DidLoadResourceFromMemoryCache, | 621 IPC_MESSAGE_HANDLER(FrameHostMsg_DidLoadResourceFromMemoryCache, |
622 OnDidLoadResourceFromMemoryCache) | 622 OnDidLoadResourceFromMemoryCache) |
623 IPC_MESSAGE_HANDLER(FrameHostMsg_DidDisplayInsecureContent, | 623 IPC_MESSAGE_HANDLER(FrameHostMsg_DidDisplayInsecureContent, |
624 OnDidDisplayInsecureContent) | 624 OnDidDisplayInsecureContent) |
625 IPC_MESSAGE_HANDLER(FrameHostMsg_DidRunInsecureContent, | 625 IPC_MESSAGE_HANDLER(FrameHostMsg_DidRunInsecureContent, |
626 OnDidRunInsecureContent) | 626 OnDidRunInsecureContent) |
| 627 IPC_MESSAGE_HANDLER(FrameHostMsg_DidDisplayContentWithCertificateErrors, |
| 628 OnDidDisplayContentWithCertificateErrors) |
| 629 IPC_MESSAGE_HANDLER(FrameHostMsg_DidRunContentWithCertificateErrors, |
| 630 OnDidRunContentWithCertificateErrors) |
627 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset) | 631 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset) |
628 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) | 632 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) |
629 IPC_MESSAGE_HANDLER(ViewHostMsg_PageScaleFactorChanged, | 633 IPC_MESSAGE_HANDLER(ViewHostMsg_PageScaleFactorChanged, |
630 OnPageScaleFactorChanged) | 634 OnPageScaleFactorChanged) |
631 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) | 635 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) |
632 IPC_MESSAGE_HANDLER(FrameHostMsg_RegisterProtocolHandler, | 636 IPC_MESSAGE_HANDLER(FrameHostMsg_RegisterProtocolHandler, |
633 OnRegisterProtocolHandler) | 637 OnRegisterProtocolHandler) |
634 IPC_MESSAGE_HANDLER(FrameHostMsg_UnregisterProtocolHandler, | 638 IPC_MESSAGE_HANDLER(FrameHostMsg_UnregisterProtocolHandler, |
635 OnUnregisterProtocolHandler) | 639 OnUnregisterProtocolHandler) |
636 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdatePageImportanceSignals, | 640 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdatePageImportanceSignals, |
(...skipping 2496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3133 } | 3137 } |
3134 } | 3138 } |
3135 | 3139 |
3136 void WebContentsImpl::OnDidDisplayInsecureContent() { | 3140 void WebContentsImpl::OnDidDisplayInsecureContent() { |
3137 RecordAction(base::UserMetricsAction("SSL.DisplayedInsecureContent")); | 3141 RecordAction(base::UserMetricsAction("SSL.DisplayedInsecureContent")); |
3138 displayed_insecure_content_ = true; | 3142 displayed_insecure_content_ = true; |
3139 SSLManager::NotifySSLInternalStateChanged( | 3143 SSLManager::NotifySSLInternalStateChanged( |
3140 GetController().GetBrowserContext()); | 3144 GetController().GetBrowserContext()); |
3141 } | 3145 } |
3142 | 3146 |
3143 void WebContentsImpl::OnDidRunInsecureContent( | 3147 void WebContentsImpl::OnDidRunInsecureContent(const GURL& security_origin, |
3144 const std::string& security_origin, const GURL& target_url) { | 3148 const GURL& target_url) { |
3145 LOG(WARNING) << security_origin << " ran insecure content from " | 3149 LOG(WARNING) << security_origin << " ran insecure content from " |
3146 << target_url.possibly_invalid_spec(); | 3150 << target_url.possibly_invalid_spec(); |
3147 RecordAction(base::UserMetricsAction("SSL.RanInsecureContent")); | 3151 RecordAction(base::UserMetricsAction("SSL.RanInsecureContent")); |
3148 if (base::EndsWith(security_origin, kDotGoogleDotCom, | 3152 if (base::EndsWith(security_origin.spec(), kDotGoogleDotCom, |
3149 base::CompareCase::INSENSITIVE_ASCII)) | 3153 base::CompareCase::INSENSITIVE_ASCII)) |
3150 RecordAction(base::UserMetricsAction("SSL.RanInsecureContentGoogle")); | 3154 RecordAction(base::UserMetricsAction("SSL.RanInsecureContentGoogle")); |
3151 controller_.ssl_manager()->DidRunInsecureContent(security_origin); | 3155 controller_.ssl_manager()->DidRunInsecureContent(security_origin); |
3152 SSLManager::NotifySSLInternalStateChanged( | 3156 SSLManager::NotifySSLInternalStateChanged( |
3153 GetController().GetBrowserContext()); | 3157 GetController().GetBrowserContext()); |
3154 } | 3158 } |
3155 | 3159 |
| 3160 void WebContentsImpl::OnDidDisplayContentWithCertificateErrors( |
| 3161 const GURL& url, |
| 3162 const std::string& security_info) { |
| 3163 SSLStatus ssl; |
| 3164 if (!DeserializeSecurityInfo(security_info, &ssl)) { |
| 3165 bad_message::ReceivedBadMessage( |
| 3166 GetRenderProcessHost(), |
| 3167 bad_message::WC_CONTENT_WITH_CERT_ERRORS_BAD_SECURITY_INFO); |
| 3168 return; |
| 3169 } |
| 3170 |
| 3171 displayed_insecure_content_ = true; |
| 3172 SSLManager::NotifySSLInternalStateChanged( |
| 3173 GetController().GetBrowserContext()); |
| 3174 } |
| 3175 |
| 3176 void WebContentsImpl::OnDidRunContentWithCertificateErrors( |
| 3177 const GURL& security_origin, |
| 3178 const GURL& url, |
| 3179 const std::string& security_info) { |
| 3180 SSLStatus ssl; |
| 3181 if (!DeserializeSecurityInfo(security_info, &ssl)) { |
| 3182 bad_message::ReceivedBadMessage( |
| 3183 GetRenderProcessHost(), |
| 3184 bad_message::WC_CONTENT_WITH_CERT_ERRORS_BAD_SECURITY_INFO); |
| 3185 return; |
| 3186 } |
| 3187 |
| 3188 controller_.ssl_manager()->DidRunInsecureContent(security_origin); |
| 3189 SSLManager::NotifySSLInternalStateChanged( |
| 3190 GetController().GetBrowserContext()); |
| 3191 } |
| 3192 |
3156 void WebContentsImpl::OnDocumentLoadedInFrame() { | 3193 void WebContentsImpl::OnDocumentLoadedInFrame() { |
3157 if (!HasValidFrameSource()) | 3194 if (!HasValidFrameSource()) |
3158 return; | 3195 return; |
3159 | 3196 |
3160 RenderFrameHostImpl* rfh = | 3197 RenderFrameHostImpl* rfh = |
3161 static_cast<RenderFrameHostImpl*>(render_frame_message_source_); | 3198 static_cast<RenderFrameHostImpl*>(render_frame_message_source_); |
3162 FOR_EACH_OBSERVER( | 3199 FOR_EACH_OBSERVER( |
3163 WebContentsObserver, observers_, DocumentLoadedInFrame(rfh)); | 3200 WebContentsObserver, observers_, DocumentLoadedInFrame(rfh)); |
3164 } | 3201 } |
3165 | 3202 |
(...skipping 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4774 return NULL; | 4811 return NULL; |
4775 } | 4812 } |
4776 | 4813 |
4777 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4814 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4778 force_disable_overscroll_content_ = force_disable; | 4815 force_disable_overscroll_content_ = force_disable; |
4779 if (view_) | 4816 if (view_) |
4780 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4817 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4781 } | 4818 } |
4782 | 4819 |
4783 } // namespace content | 4820 } // namespace content |
OLD | NEW |