Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 #include "platform/weborigin/SecurityOrigin.h" | 43 #include "platform/weborigin/SecurityOrigin.h" |
| 44 #include "platform/weborigin/SecurityPolicy.h" | 44 #include "platform/weborigin/SecurityPolicy.h" |
| 45 | 45 |
| 46 namespace blink { | 46 namespace blink { |
| 47 | 47 |
| 48 static LocalFrame* createWindow(LocalFrame& openerFrame, LocalFrame& lookupFrame , const FrameLoadRequest& request, const WindowFeatures& features, NavigationPol icy policy, ShouldSendReferrer shouldSendReferrer, bool& created) | 48 static LocalFrame* createWindow(LocalFrame& openerFrame, LocalFrame& lookupFrame , const FrameLoadRequest& request, const WindowFeatures& features, NavigationPol icy policy, ShouldSendReferrer shouldSendReferrer, bool& created) |
| 49 { | 49 { |
| 50 ASSERT(!features.dialog || request.frameName().isEmpty()); | 50 ASSERT(!features.dialog || request.frameName().isEmpty()); |
| 51 | 51 |
| 52 if (!request.frameName().isEmpty() && request.frameName() != "_blank" && pol icy == NavigationPolicyIgnore) { | 52 if (!request.frameName().isEmpty() && request.frameName() != "_blank" && pol icy == NavigationPolicyIgnore) { |
| 53 if (LocalFrame* frame = lookupFrame.loader().findFrameForNavigation(requ est.frameName(), openerFrame.document())) { | 53 if (Frame* frame = lookupFrame.findFrameForNavigation(request.frameName( ), &openerFrame)) { |
|
dcheng
2014/12/13 01:55:49
openerFrame should never be null right? Should we
Nate Chapin
2014/12/20 00:09:14
Done.
| |
| 54 if (request.frameName() != "_self") | 54 if (request.frameName() != "_self") |
| 55 frame->page()->focusController().setFocusedFrame(frame); | 55 frame->page()->focusController().setFocusedFrame(frame); |
| 56 created = false; | 56 created = false; |
| 57 return frame; | 57 return frame->isLocalFrame() ? toLocalFrame(frame) : 0; |
|
dcheng
2014/12/13 01:55:49
nullptr
Nate Chapin
2014/12/20 00:09:14
Done.
| |
| 58 } | 58 } |
| 59 } | 59 } |
| 60 | 60 |
| 61 // Sandboxed frames cannot open new auxiliary browsing contexts. | 61 // Sandboxed frames cannot open new auxiliary browsing contexts. |
| 62 if (openerFrame.document()->isSandboxed(SandboxPopups)) { | 62 if (openerFrame.document()->isSandboxed(SandboxPopups)) { |
| 63 // FIXME: This message should be moved off the console once a solution t o https://bugs.webkit.org/show_bug.cgi?id=103274 exists. | 63 // FIXME: This message should be moved off the console once a solution t o https://bugs.webkit.org/show_bug.cgi?id=103274 exists. |
| 64 openerFrame.document()->addConsoleMessage(ConsoleMessage::create(Securit yMessageSource, ErrorMessageLevel, "Blocked opening '" + request.resourceRequest ().url().elidedString() + "' in a new window because the request was made in a s andboxed frame whose 'allow-popups' permission is not set.")); | 64 openerFrame.document()->addConsoleMessage(ConsoleMessage::create(Securit yMessageSource, ErrorMessageLevel, "Blocked opening '" + request.resourceRequest ().url().elidedString() + "' in a new window because the request was made in a s andboxed frame whose 'allow-popups' permission is not set.")); |
| 65 return nullptr; | 65 return nullptr; |
| 66 } | 66 } |
| 67 | 67 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 184 if (shouldSendReferrer == MaybeSendReferrer) { | 184 if (shouldSendReferrer == MaybeSendReferrer) { |
| 185 newFrame->loader().setOpener(&openerFrame); | 185 newFrame->loader().setOpener(&openerFrame); |
| 186 newFrame->document()->setReferrerPolicy(openerFrame.document()->referrer Policy()); | 186 newFrame->document()->setReferrerPolicy(openerFrame.document()->referrer Policy()); |
| 187 } | 187 } |
| 188 FrameLoadRequest newRequest(0, request.resourceRequest()); | 188 FrameLoadRequest newRequest(0, request.resourceRequest()); |
| 189 newRequest.setFormState(request.formState()); | 189 newRequest.setFormState(request.formState()); |
| 190 newFrame->loader().load(newRequest); | 190 newFrame->loader().load(newRequest); |
| 191 } | 191 } |
| 192 | 192 |
| 193 } // namespace blink | 193 } // namespace blink |
| OLD | NEW |