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

Side by Side Diff: third_party/WebKit/Source/core/loader/MixedContentChecker.cpp

Issue 1497423002: Revert of Downgrade lock icon for broken-HTTPS subresources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix conflict Created 5 years 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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 if (frameType == WebURLRequest::FrameTypeNested) { 451 if (frameType == WebURLRequest::FrameTypeNested) {
452 // FIXME: Deal with RemoteFrames. 452 // FIXME: Deal with RemoteFrames.
453 Frame* parentFrame = effectiveFrame->tree().parent(); 453 Frame* parentFrame = effectiveFrame->tree().parent();
454 ASSERT(parentFrame); 454 ASSERT(parentFrame);
455 if (parentFrame->isLocalFrame()) 455 if (parentFrame->isLocalFrame())
456 effectiveFrame = toLocalFrame(parentFrame); 456 effectiveFrame = toLocalFrame(parentFrame);
457 } 457 }
458 return effectiveFrame; 458 return effectiveFrame;
459 } 459 }
460 460
461 void MixedContentChecker::handleCertificateError(LocalFrame* frame, const Resour ceRequest& request, const ResourceResponse& response)
462 {
463 WebURLRequest::FrameType frameType = request.frameType();
464 LocalFrame* effectiveFrame = effectiveFrameForFrameType(frame, frameType);
465 if (frameType == WebURLRequest::FrameTypeTopLevel || !effectiveFrame)
466 return;
467
468 FrameLoaderClient* client = effectiveFrame->loader().client();
469 WebURLRequest::RequestContext requestContext = request.requestContext();
470 ContextType contextType = MixedContentChecker::contextTypeFromContext(reques tContext, frame);
471 if (contextType == ContextTypeBlockable) {
472 client->didRunContentWithCertificateErrors(response.url(), response.getS ecurityInfo(), effectiveFrame->document()->url(), effectiveFrame->loader().docum entLoader()->response().getSecurityInfo());
473 } else {
474 // contextTypeFromContext() never returns NotMixedContent (it
475 // computes the type of mixed content, given that the content is
476 // mixed).
477 ASSERT(contextType != ContextTypeNotMixedContent);
478 client->didDisplayContentWithCertificateErrors(response.url(), response. getSecurityInfo(), effectiveFrame->document()->url(), effectiveFrame->loader().d ocumentLoader()->response().getSecurityInfo());
479 }
480 }
481
482 MixedContentChecker::ContextType MixedContentChecker::contextTypeForInspector(Lo calFrame* frame, const ResourceRequest& request) 461 MixedContentChecker::ContextType MixedContentChecker::contextTypeForInspector(Lo calFrame* frame, const ResourceRequest& request)
483 { 462 {
484 LocalFrame* effectiveFrame = effectiveFrameForFrameType(frame, request.frame Type()); 463 LocalFrame* effectiveFrame = effectiveFrameForFrameType(frame, request.frame Type());
485 464
486 LocalFrame* mixedFrame = inWhichFrameIsContentMixed(effectiveFrame, request. frameType(), request.url()); 465 LocalFrame* mixedFrame = inWhichFrameIsContentMixed(effectiveFrame, request. frameType(), request.url());
487 if (!mixedFrame) 466 if (!mixedFrame)
488 return ContextTypeNotMixedContent; 467 return ContextTypeNotMixedContent;
489 468
490 // See comment in shouldBlockFetch() about loading the main resource of a su bframe. 469 // See comment in shouldBlockFetch() about loading the main resource of a su bframe.
491 if (request.frameType() == WebURLRequest::FrameTypeNested && !SchemeRegistry ::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())) { 470 if (request.frameType() == WebURLRequest::FrameTypeNested && !SchemeRegistry ::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())) {
492 return ContextTypeOptionallyBlockable; 471 return ContextTypeOptionallyBlockable;
493 } 472 }
494 473
495 return contextTypeFromContext(request.requestContext(), mixedFrame); 474 return contextTypeFromContext(request.requestContext(), mixedFrame);
496 } 475 }
497 476
498 } // namespace blink 477 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698