Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(671)

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1415923015: Downgrade lock icon for broken-HTTPS subresources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unnecessary includes Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 2509 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, 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(
jww 2015/11/20 01:25:08 Ignorant question: It seems really heavy weight to
estark 2015/11/23 23:40:24 Ah, when I was first working on this, I couldn't f
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 if (!controller_.ssl_manager()->IsContentWithCertificateErrorsRelevant(url,
3172 ssl)) {
jww 2015/11/20 01:25:08 nit: Was this a git cl format decision? If so, fin
estark 2015/11/23 23:40:24 yep :(
3173 return;
3174 }
3175
3176 displayed_insecure_content_ = true;
3177 SSLManager::NotifySSLInternalStateChanged(
3178 GetController().GetBrowserContext());
3179 }
3180
3181 void WebContentsImpl::OnDidRunContentWithCertificateErrors(
3182 const std::string& security_origin,
3183 const GURL& url,
3184 const std::string& security_info) {
3185 SSLStatus ssl;
3186 if (!DeserializeSecurityInfo(security_info, &ssl)) {
3187 bad_message::ReceivedBadMessage(
3188 GetRenderProcessHost(),
3189 bad_message::WC_CONTENT_WITH_CERT_ERRORS_BAD_SECURITY_INFO);
3190 return;
3191 }
3192
3193 if (!controller_.ssl_manager()->IsContentWithCertificateErrorsRelevant(url,
3194 ssl)) {
3195 return;
3196 }
3197
3198 controller_.ssl_manager()->DidRunInsecureContent(security_origin);
3199 SSLManager::NotifySSLInternalStateChanged(
3200 GetController().GetBrowserContext());
3201 }
3202
3156 void WebContentsImpl::OnDocumentLoadedInFrame() { 3203 void WebContentsImpl::OnDocumentLoadedInFrame() {
3157 if (!HasValidFrameSource()) 3204 if (!HasValidFrameSource())
3158 return; 3205 return;
3159 3206
3160 RenderFrameHostImpl* rfh = 3207 RenderFrameHostImpl* rfh =
3161 static_cast<RenderFrameHostImpl*>(render_frame_message_source_); 3208 static_cast<RenderFrameHostImpl*>(render_frame_message_source_);
3162 FOR_EACH_OBSERVER( 3209 FOR_EACH_OBSERVER(
3163 WebContentsObserver, observers_, DocumentLoadedInFrame(rfh)); 3210 WebContentsObserver, observers_, DocumentLoadedInFrame(rfh));
3164 } 3211 }
3165 3212
(...skipping 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after
4774 return NULL; 4821 return NULL;
4775 } 4822 }
4776 4823
4777 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4824 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4778 force_disable_overscroll_content_ = force_disable; 4825 force_disable_overscroll_content_ = force_disable;
4779 if (view_) 4826 if (view_)
4780 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4827 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4781 } 4828 }
4782 4829
4783 } // namespace content 4830 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698