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

Side by Side Diff: Source/core/html/HTMLFormElement.cpp

Issue 566533003: Mixed Content: Make MixedContentChecker completely static. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixing tests. Created 6 years, 3 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/fetch/ResourceFetcher.cpp ('k') | Source/core/html/HTMLPlugInElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 if (!targetFrame) { 435 if (!targetFrame) {
436 if (!LocalDOMWindow::allowPopUp(*document().frame()) && !UserGestureIndi cator::processingUserGesture()) 436 if (!LocalDOMWindow::allowPopUp(*document().frame()) && !UserGestureIndi cator::processingUserGesture())
437 return; 437 return;
438 targetFrame = document().frame(); 438 targetFrame = document().frame();
439 } else { 439 } else {
440 submission->clearTarget(); 440 submission->clearTarget();
441 } 441 }
442 if (!targetFrame->page()) 442 if (!targetFrame->page())
443 return; 443 return;
444 444
445 if (MixedContentChecker::isMixedContent(document().securityOrigin(), submiss ion->action())) { 445 UseCounter::count(document(), UseCounter::FormsSubmitted);
446 if (MixedContentChecker::checkFormAction(document().frame(), submission->act ion()))
446 UseCounter::count(document(), UseCounter::MixedContentFormsSubmitted); 447 UseCounter::count(document(), UseCounter::MixedContentFormsSubmitted);
447 if (!document().frame()->loader().mixedContentChecker()->canSubmitToInse cureForm(document().securityOrigin(), submission->action()))
448 return;
449 } else {
450 UseCounter::count(document(), UseCounter::FormsSubmitted);
451 }
452 448
453 submission->setReferrer(Referrer(document().outgoingReferrer(), document().r eferrerPolicy())); 449 submission->setReferrer(Referrer(document().outgoingReferrer(), document().r eferrerPolicy()));
454 submission->setOrigin(document().outgoingOrigin()); 450 submission->setOrigin(document().outgoingOrigin());
455 451
456 targetFrame->navigationScheduler().scheduleFormSubmission(submission); 452 targetFrame->navigationScheduler().scheduleFormSubmission(submission);
457 } 453 }
458 454
459 void HTMLFormElement::reset() 455 void HTMLFormElement::reset()
460 { 456 {
461 LocalFrame* frame = document().frame(); 457 LocalFrame* frame = document().frame();
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 m_pendingAutocompleteEventsQueue->enqueueEvent(event.release()); 511 m_pendingAutocompleteEventsQueue->enqueueEvent(event.release());
516 } 512 }
517 513
518 void HTMLFormElement::parseAttribute(const QualifiedName& name, const AtomicStri ng& value) 514 void HTMLFormElement::parseAttribute(const QualifiedName& name, const AtomicStri ng& value)
519 { 515 {
520 if (name == actionAttr) { 516 if (name == actionAttr) {
521 m_attributes.parseAction(value); 517 m_attributes.parseAction(value);
522 // If the new action attribute is pointing to insecure "action" location from a secure page 518 // If the new action attribute is pointing to insecure "action" location from a secure page
523 // it is marked as "passive" mixed content. 519 // it is marked as "passive" mixed content.
524 KURL actionURL = document().completeURL(m_attributes.action().isEmpty() ? document().url().string() : m_attributes.action()); 520 KURL actionURL = document().completeURL(m_attributes.action().isEmpty() ? document().url().string() : m_attributes.action());
525 if (document().frame() && MixedContentChecker::isMixedContent(document() .securityOrigin(), actionURL)) 521 MixedContentChecker::checkFormAction(document().frame(), actionURL);
526 document().frame()->loader().mixedContentChecker()->canSubmitToInsec ureForm(document().securityOrigin(), actionURL);
527 } else if (name == targetAttr) 522 } else if (name == targetAttr)
528 m_attributes.setTarget(value); 523 m_attributes.setTarget(value);
529 else if (name == methodAttr) 524 else if (name == methodAttr)
530 m_attributes.updateMethodType(value); 525 m_attributes.updateMethodType(value);
531 else if (name == enctypeAttr) 526 else if (name == enctypeAttr)
532 m_attributes.updateEncodingType(value); 527 m_attributes.updateEncodingType(value);
533 else if (name == accept_charsetAttr) 528 else if (name == accept_charsetAttr)
534 m_attributes.setAcceptCharset(value); 529 m_attributes.setAcceptCharset(value);
535 else if (name == onautocompleteAttr) 530 else if (name == onautocompleteAttr)
536 setAttributeEventListener(EventTypeNames::autocomplete, createAttributeE ventListener(this, name, value, eventParameterName())); 531 setAttributeEventListener(EventTypeNames::autocomplete, createAttributeE ventListener(this, name, value, eventParameterName()));
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 } 839 }
845 840
846 void HTMLFormElement::setDemoted(bool demoted) 841 void HTMLFormElement::setDemoted(bool demoted)
847 { 842 {
848 if (demoted) 843 if (demoted)
849 UseCounter::count(document(), UseCounter::DemotedFormElement); 844 UseCounter::count(document(), UseCounter::DemotedFormElement);
850 m_wasDemoted = demoted; 845 m_wasDemoted = demoted;
851 } 846 }
852 847
853 } // namespace 848 } // namespace
OLDNEW
« no previous file with comments | « Source/core/fetch/ResourceFetcher.cpp ('k') | Source/core/html/HTMLPlugInElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698