| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
| 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> | 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> |
| 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. |
| 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> | 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> |
| 8 * Copyright (C) 2011 Google Inc. All rights reserved. | 8 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 9 * | 9 * |
| 10 * Redistribution and use in source and binary forms, with or without | 10 * Redistribution and use in source and binary forms, with or without |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 if (!request.originDocument()->securityOrigin()->canDisplay(url)) { | 686 if (!request.originDocument()->securityOrigin()->canDisplay(url)) { |
| 687 reportLocalLoadFailed(m_frame, url.elidedString()); | 687 reportLocalLoadFailed(m_frame, url.elidedString()); |
| 688 return false; | 688 return false; |
| 689 } | 689 } |
| 690 | 690 |
| 691 if (!request.form() && request.frameName().isEmpty()) | 691 if (!request.form() && request.frameName().isEmpty()) |
| 692 request.setFrameName(m_frame->document()->baseTarget()); | 692 request.setFrameName(m_frame->document()->baseTarget()); |
| 693 return true; | 693 return true; |
| 694 } | 694 } |
| 695 | 695 |
| 696 static bool shouldOpenInNewWindow(LocalFrame* targetFrame, const FrameLoadReques
t& request, NavigationPolicy policy) | 696 static bool shouldOpenInNewWindow(Frame* targetFrame, const FrameLoadRequest& re
quest, NavigationPolicy policy) |
| 697 { | 697 { |
| 698 if (!targetFrame && !request.frameName().isEmpty()) | 698 if (!targetFrame && !request.frameName().isEmpty()) |
| 699 return true; | 699 return true; |
| 700 // FIXME: This case is a workaround for the fact that ctrl+clicking a form s
ubmission incorrectly | 700 // FIXME: This case is a workaround for the fact that ctrl+clicking a form s
ubmission incorrectly |
| 701 // sends as a GET rather than a POST if it creates a new window in a differe
nt process. | 701 // sends as a GET rather than a POST if it creates a new window in a differe
nt process. |
| 702 return request.form() && policy != NavigationPolicyCurrentTab; | 702 return request.form() && policy != NavigationPolicyCurrentTab; |
| 703 } | 703 } |
| 704 | 704 |
| 705 static NavigationType determineNavigationType(FrameLoadType frameLoadType, bool
isFormSubmission, bool haveEvent) | 705 static NavigationType determineNavigationType(FrameLoadType frameLoadType, bool
isFormSubmission, bool haveEvent) |
| 706 { | 706 { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 | 771 |
| 772 if (m_inStopAllLoaders) | 772 if (m_inStopAllLoaders) |
| 773 return; | 773 return; |
| 774 | 774 |
| 775 FrameLoadRequest request(passedRequest); | 775 FrameLoadRequest request(passedRequest); |
| 776 request.resourceRequest().setHasUserGesture(UserGestureIndicator::processing
UserGesture()); | 776 request.resourceRequest().setHasUserGesture(UserGestureIndicator::processing
UserGesture()); |
| 777 | 777 |
| 778 if (!prepareRequestForThisFrame(request)) | 778 if (!prepareRequestForThisFrame(request)) |
| 779 return; | 779 return; |
| 780 | 780 |
| 781 RefPtrWillBeRawPtr<LocalFrame> targetFrame = toLocalFrame(request.form() ? n
ullptr : m_frame->findFrameForNavigation(AtomicString(request.frameName()), *m_f
rame)); | 781 RefPtrWillBeRawPtr<Frame> targetFrame = request.form() ? nullptr : m_frame->
findFrameForNavigation(AtomicString(request.frameName()), *m_frame); |
| 782 if (targetFrame && targetFrame.get() != m_frame) { | 782 if (targetFrame && targetFrame.get() != m_frame) { |
| 783 bool wasInSamePage = targetFrame->page() == m_frame->page(); | 783 bool wasInSamePage = targetFrame->page() == m_frame->page(); |
| 784 | 784 |
| 785 request.setFrameName("_self"); | 785 request.setFrameName("_self"); |
| 786 targetFrame->loader().load(request); | 786 targetFrame->navigate(request); |
| 787 Page* page = targetFrame->page(); | 787 Page* page = targetFrame->page(); |
| 788 if (!wasInSamePage && page) | 788 if (!wasInSamePage && page) |
| 789 page->chromeClient().focus(); | 789 page->chromeClient().focus(); |
| 790 return; | 790 return; |
| 791 } | 791 } |
| 792 | 792 |
| 793 setReferrerForFrameRequest(request.resourceRequest(), request.shouldSendRefe
rrer(), request.originDocument()); | 793 setReferrerForFrameRequest(request.resourceRequest(), request.shouldSendRefe
rrer(), request.originDocument()); |
| 794 | 794 |
| 795 FrameLoadType newLoadType = determineFrameLoadType(request); | 795 FrameLoadType newLoadType = determineFrameLoadType(request); |
| 796 NavigationPolicy policy = navigationPolicyForRequest(request); | 796 NavigationPolicy policy = navigationPolicyForRequest(request); |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1444 // FIXME: We need a way to propagate insecure requests policy flags to | 1444 // FIXME: We need a way to propagate insecure requests policy flags to |
| 1445 // out-of-process frames. For now, we'll always use default behavior. | 1445 // out-of-process frames. For now, we'll always use default behavior. |
| 1446 if (!parentFrame->isLocalFrame()) | 1446 if (!parentFrame->isLocalFrame()) |
| 1447 return nullptr; | 1447 return nullptr; |
| 1448 | 1448 |
| 1449 ASSERT(toLocalFrame(parentFrame)->document()); | 1449 ASSERT(toLocalFrame(parentFrame)->document()); |
| 1450 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade()
; | 1450 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade()
; |
| 1451 } | 1451 } |
| 1452 | 1452 |
| 1453 } // namespace blink | 1453 } // namespace blink |
| OLD | NEW |