| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 return 0; | 74 return 0; |
| 75 | 75 |
| 76 Page* page = oldPage->chrome().client().createWindow(&openerFrame, request,
features, policy, shouldSendReferrer); | 76 Page* page = oldPage->chrome().client().createWindow(&openerFrame, request,
features, policy, shouldSendReferrer); |
| 77 if (!page) | 77 if (!page) |
| 78 return 0; | 78 return 0; |
| 79 FrameHost* host = &page->frameHost(); | 79 FrameHost* host = &page->frameHost(); |
| 80 | 80 |
| 81 ASSERT(page->mainFrame()); | 81 ASSERT(page->mainFrame()); |
| 82 LocalFrame& frame = *page->mainFrame(); | 82 LocalFrame& frame = *page->mainFrame(); |
| 83 | 83 |
| 84 frame.loader().forceSandboxFlags(openerFrame.document()->sandboxFlags()); | |
| 85 | |
| 86 if (request.frameName() != "_blank") | 84 if (request.frameName() != "_blank") |
| 87 frame.tree().setName(request.frameName()); | 85 frame.tree().setName(request.frameName()); |
| 88 | 86 |
| 89 host->chrome().setWindowFeatures(features); | 87 host->chrome().setWindowFeatures(features); |
| 90 | 88 |
| 91 // 'x' and 'y' specify the location of the window, while 'width' and 'height
' | 89 // 'x' and 'y' specify the location of the window, while 'width' and 'height
' |
| 92 // specify the size of the viewport. We can only resize the window, so adjus
t | 90 // specify the size of the viewport. We can only resize the window, so adjus
t |
| 93 // for the difference between the window size and the viewport size. | 91 // for the difference between the window size and the viewport size. |
| 94 | 92 |
| 95 FloatRect windowRect = host->chrome().windowRect(); | 93 FloatRect windowRect = host->chrome().windowRect(); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 FrameLoader::addHTTPOriginIfNeeded(request, AtomicString(firstFrame.document
()->outgoingOrigin())); | 132 FrameLoader::addHTTPOriginIfNeeded(request, AtomicString(firstFrame.document
()->outgoingOrigin())); |
| 135 FrameLoadRequest frameRequest(callingWindow.document(), request, frameName); | 133 FrameLoadRequest frameRequest(callingWindow.document(), request, frameName); |
| 136 | 134 |
| 137 // We pass the opener frame for the lookupFrame in case the active frame is
different from | 135 // We pass the opener frame for the lookupFrame in case the active frame is
different from |
| 138 // the opener frame, and the name references a frame relative to the opener
frame. | 136 // the opener frame, and the name references a frame relative to the opener
frame. |
| 139 bool created; | 137 bool created; |
| 140 LocalFrame* newFrame = createWindow(*activeFrame, openerFrame, frameRequest,
windowFeatures, NavigationPolicyIgnore, MaybeSendReferrer, created); | 138 LocalFrame* newFrame = createWindow(*activeFrame, openerFrame, frameRequest,
windowFeatures, NavigationPolicyIgnore, MaybeSendReferrer, created); |
| 141 if (!newFrame) | 139 if (!newFrame) |
| 142 return 0; | 140 return 0; |
| 143 | 141 |
| 142 if (newFrame != &openerFrame && newFrame != openerFrame.tree().top()) |
| 143 newFrame->loader().forceSandboxFlags(openerFrame.document()->sandboxFlag
s()); |
| 144 |
| 144 newFrame->loader().setOpener(&openerFrame); | 145 newFrame->loader().setOpener(&openerFrame); |
| 145 newFrame->page()->setOpenedByDOM(); | 146 newFrame->page()->setOpenedByDOM(); |
| 146 | 147 |
| 147 if (newFrame->domWindow()->isInsecureScriptAccess(callingWindow, completedUR
L)) | 148 if (newFrame->domWindow()->isInsecureScriptAccess(callingWindow, completedUR
L)) |
| 148 return newFrame; | 149 return newFrame; |
| 149 | 150 |
| 150 if (function) | 151 if (function) |
| 151 function(newFrame->domWindow(), functionContext); | 152 function(newFrame->domWindow(), functionContext); |
| 152 | 153 |
| 153 if (created) { | 154 if (created) { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 182 if (shouldSendReferrer == MaybeSendReferrer) { | 183 if (shouldSendReferrer == MaybeSendReferrer) { |
| 183 newFrame->loader().setOpener(&openerFrame); | 184 newFrame->loader().setOpener(&openerFrame); |
| 184 newFrame->document()->setReferrerPolicy(openerFrame.document()->referrer
Policy()); | 185 newFrame->document()->setReferrerPolicy(openerFrame.document()->referrer
Policy()); |
| 185 } | 186 } |
| 186 FrameLoadRequest newRequest(0, request.resourceRequest()); | 187 FrameLoadRequest newRequest(0, request.resourceRequest()); |
| 187 newRequest.setFormState(request.formState()); | 188 newRequest.setFormState(request.formState()); |
| 188 newFrame->loader().load(newRequest); | 189 newFrame->loader().load(newRequest); |
| 189 } | 190 } |
| 190 | 191 |
| 191 } // namespace WebCore | 192 } // namespace WebCore |
| OLD | NEW |