| 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 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 IPC_MESSAGE_HANDLER(FrameHostMsg_MediaPausedNotification, | 638 IPC_MESSAGE_HANDLER(FrameHostMsg_MediaPausedNotification, |
| 639 OnMediaPausedNotification) | 639 OnMediaPausedNotification) |
| 640 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFirstVisuallyNonEmptyPaint, | 640 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFirstVisuallyNonEmptyPaint, |
| 641 OnFirstVisuallyNonEmptyPaint) | 641 OnFirstVisuallyNonEmptyPaint) |
| 642 IPC_MESSAGE_HANDLER(FrameHostMsg_DidLoadResourceFromMemoryCache, | 642 IPC_MESSAGE_HANDLER(FrameHostMsg_DidLoadResourceFromMemoryCache, |
| 643 OnDidLoadResourceFromMemoryCache) | 643 OnDidLoadResourceFromMemoryCache) |
| 644 IPC_MESSAGE_HANDLER(FrameHostMsg_DidDisplayInsecureContent, | 644 IPC_MESSAGE_HANDLER(FrameHostMsg_DidDisplayInsecureContent, |
| 645 OnDidDisplayInsecureContent) | 645 OnDidDisplayInsecureContent) |
| 646 IPC_MESSAGE_HANDLER(FrameHostMsg_DidRunInsecureContent, | 646 IPC_MESSAGE_HANDLER(FrameHostMsg_DidRunInsecureContent, |
| 647 OnDidRunInsecureContent) | 647 OnDidRunInsecureContent) |
| 648 IPC_MESSAGE_HANDLER(FrameHostMsg_DidDisplayContentWithCertificateErrors, | |
| 649 OnDidDisplayContentWithCertificateErrors) | |
| 650 IPC_MESSAGE_HANDLER(FrameHostMsg_DidRunContentWithCertificateErrors, | |
| 651 OnDidRunContentWithCertificateErrors) | |
| 652 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset) | 648 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset) |
| 653 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) | 649 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateZoomLimits, OnUpdateZoomLimits) |
| 654 IPC_MESSAGE_HANDLER(ViewHostMsg_PageScaleFactorChanged, | 650 IPC_MESSAGE_HANDLER(ViewHostMsg_PageScaleFactorChanged, |
| 655 OnPageScaleFactorChanged) | 651 OnPageScaleFactorChanged) |
| 656 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) | 652 IPC_MESSAGE_HANDLER(ViewHostMsg_EnumerateDirectory, OnEnumerateDirectory) |
| 657 IPC_MESSAGE_HANDLER(FrameHostMsg_RegisterProtocolHandler, | 653 IPC_MESSAGE_HANDLER(FrameHostMsg_RegisterProtocolHandler, |
| 658 OnRegisterProtocolHandler) | 654 OnRegisterProtocolHandler) |
| 659 IPC_MESSAGE_HANDLER(FrameHostMsg_UnregisterProtocolHandler, | 655 IPC_MESSAGE_HANDLER(FrameHostMsg_UnregisterProtocolHandler, |
| 660 OnUnregisterProtocolHandler) | 656 OnUnregisterProtocolHandler) |
| 661 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdatePageImportanceSignals, | 657 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdatePageImportanceSignals, |
| (...skipping 2516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3178 } | 3174 } |
| 3179 } | 3175 } |
| 3180 | 3176 |
| 3181 void WebContentsImpl::OnDidDisplayInsecureContent() { | 3177 void WebContentsImpl::OnDidDisplayInsecureContent() { |
| 3182 RecordAction(base::UserMetricsAction("SSL.DisplayedInsecureContent")); | 3178 RecordAction(base::UserMetricsAction("SSL.DisplayedInsecureContent")); |
| 3183 displayed_insecure_content_ = true; | 3179 displayed_insecure_content_ = true; |
| 3184 SSLManager::NotifySSLInternalStateChanged( | 3180 SSLManager::NotifySSLInternalStateChanged( |
| 3185 GetController().GetBrowserContext()); | 3181 GetController().GetBrowserContext()); |
| 3186 } | 3182 } |
| 3187 | 3183 |
| 3188 void WebContentsImpl::OnDidRunInsecureContent(const GURL& security_origin, | 3184 void WebContentsImpl::OnDidRunInsecureContent( |
| 3189 const GURL& target_url) { | 3185 const std::string& security_origin, const GURL& target_url) { |
| 3190 LOG(WARNING) << security_origin << " ran insecure content from " | 3186 LOG(WARNING) << security_origin << " ran insecure content from " |
| 3191 << target_url.possibly_invalid_spec(); | 3187 << target_url.possibly_invalid_spec(); |
| 3192 RecordAction(base::UserMetricsAction("SSL.RanInsecureContent")); | 3188 RecordAction(base::UserMetricsAction("SSL.RanInsecureContent")); |
| 3193 if (base::EndsWith(security_origin.spec(), kDotGoogleDotCom, | 3189 if (base::EndsWith(security_origin, kDotGoogleDotCom, |
| 3194 base::CompareCase::INSENSITIVE_ASCII)) | 3190 base::CompareCase::INSENSITIVE_ASCII)) |
| 3195 RecordAction(base::UserMetricsAction("SSL.RanInsecureContentGoogle")); | 3191 RecordAction(base::UserMetricsAction("SSL.RanInsecureContentGoogle")); |
| 3196 controller_.ssl_manager()->DidRunInsecureContent(security_origin); | 3192 controller_.ssl_manager()->DidRunInsecureContent(security_origin); |
| 3197 SSLManager::NotifySSLInternalStateChanged( | 3193 SSLManager::NotifySSLInternalStateChanged( |
| 3198 GetController().GetBrowserContext()); | 3194 GetController().GetBrowserContext()); |
| 3199 } | 3195 } |
| 3200 | 3196 |
| 3201 void WebContentsImpl::OnDidDisplayContentWithCertificateErrors( | |
| 3202 const GURL& url, | |
| 3203 const std::string& security_info) { | |
| 3204 SSLStatus ssl; | |
| 3205 if (!DeserializeSecurityInfo(security_info, &ssl)) { | |
| 3206 bad_message::ReceivedBadMessage( | |
| 3207 GetRenderProcessHost(), | |
| 3208 bad_message::WC_CONTENT_WITH_CERT_ERRORS_BAD_SECURITY_INFO); | |
| 3209 return; | |
| 3210 } | |
| 3211 | |
| 3212 displayed_insecure_content_ = true; | |
| 3213 SSLManager::NotifySSLInternalStateChanged( | |
| 3214 GetController().GetBrowserContext()); | |
| 3215 } | |
| 3216 | |
| 3217 void WebContentsImpl::OnDidRunContentWithCertificateErrors( | |
| 3218 const GURL& security_origin, | |
| 3219 const GURL& url, | |
| 3220 const std::string& security_info) { | |
| 3221 SSLStatus ssl; | |
| 3222 if (!DeserializeSecurityInfo(security_info, &ssl)) { | |
| 3223 bad_message::ReceivedBadMessage( | |
| 3224 GetRenderProcessHost(), | |
| 3225 bad_message::WC_CONTENT_WITH_CERT_ERRORS_BAD_SECURITY_INFO); | |
| 3226 return; | |
| 3227 } | |
| 3228 | |
| 3229 controller_.ssl_manager()->DidRunInsecureContent(security_origin); | |
| 3230 SSLManager::NotifySSLInternalStateChanged( | |
| 3231 GetController().GetBrowserContext()); | |
| 3232 } | |
| 3233 | |
| 3234 void WebContentsImpl::OnDocumentLoadedInFrame() { | 3197 void WebContentsImpl::OnDocumentLoadedInFrame() { |
| 3235 if (!HasValidFrameSource()) | 3198 if (!HasValidFrameSource()) |
| 3236 return; | 3199 return; |
| 3237 | 3200 |
| 3238 RenderFrameHostImpl* rfh = | 3201 RenderFrameHostImpl* rfh = |
| 3239 static_cast<RenderFrameHostImpl*>(render_frame_message_source_); | 3202 static_cast<RenderFrameHostImpl*>(render_frame_message_source_); |
| 3240 FOR_EACH_OBSERVER( | 3203 FOR_EACH_OBSERVER( |
| 3241 WebContentsObserver, observers_, DocumentLoadedInFrame(rfh)); | 3204 WebContentsObserver, observers_, DocumentLoadedInFrame(rfh)); |
| 3242 } | 3205 } |
| 3243 | 3206 |
| (...skipping 1596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4840 return NULL; | 4803 return NULL; |
| 4841 } | 4804 } |
| 4842 | 4805 |
| 4843 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4806 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
| 4844 force_disable_overscroll_content_ = force_disable; | 4807 force_disable_overscroll_content_ = force_disable; |
| 4845 if (view_) | 4808 if (view_) |
| 4846 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4809 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
| 4847 } | 4810 } |
| 4848 | 4811 |
| 4849 } // namespace content | 4812 } // namespace content |
| OLD | NEW |