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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // 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. |
137 bool created; | 137 bool created; |
138 LocalFrame* newFrame = createWindow(*activeFrame, openerFrame, frameRequest,
windowFeatures, NavigationPolicyIgnore, MaybeSendReferrer, created); | 138 LocalFrame* newFrame = createWindow(*activeFrame, openerFrame, frameRequest,
windowFeatures, NavigationPolicyIgnore, MaybeSendReferrer, created); |
139 if (!newFrame) | 139 if (!newFrame) |
140 return 0; | 140 return 0; |
141 | 141 |
142 if (newFrame != &openerFrame && newFrame != openerFrame.tree().top()) | 142 if (newFrame != &openerFrame && newFrame != openerFrame.tree().top()) |
143 newFrame->loader().forceSandboxFlags(openerFrame.document()->sandboxFlag
s()); | 143 newFrame->loader().forceSandboxFlags(openerFrame.document()->sandboxFlag
s()); |
144 | 144 |
145 newFrame->loader().setOpener(&openerFrame); | 145 newFrame->loader().setOpener(&openerFrame); |
146 newFrame->page()->setOpenedByDOM(); | |
147 | 146 |
148 if (newFrame->domWindow()->isInsecureScriptAccess(callingWindow, completedUR
L)) | 147 if (newFrame->domWindow()->isInsecureScriptAccess(callingWindow, completedUR
L)) |
149 return newFrame; | 148 return newFrame; |
150 | 149 |
151 if (function) | 150 if (function) |
152 function(newFrame->domWindow(), functionContext); | 151 function(newFrame->domWindow(), functionContext); |
153 | 152 |
154 if (created) { | 153 if (created) { |
155 FrameLoadRequest request(callingWindow.document(), ResourceRequest(compl
etedURL, referrer)); | 154 FrameLoadRequest request(callingWindow.document(), ResourceRequest(compl
etedURL, referrer)); |
156 newFrame->loader().load(request); | 155 newFrame->loader().load(request); |
(...skipping 15 matching lines...) Expand all Loading... |
172 return; | 171 return; |
173 | 172 |
174 if (policy == NavigationPolicyCurrentTab) | 173 if (policy == NavigationPolicyCurrentTab) |
175 policy = NavigationPolicyNewForegroundTab; | 174 policy = NavigationPolicyNewForegroundTab; |
176 | 175 |
177 WindowFeatures features; | 176 WindowFeatures features; |
178 bool created; | 177 bool created; |
179 LocalFrame* newFrame = createWindow(openerFrame, openerFrame, request, featu
res, policy, shouldSendReferrer, created); | 178 LocalFrame* newFrame = createWindow(openerFrame, openerFrame, request, featu
res, policy, shouldSendReferrer, created); |
180 if (!newFrame) | 179 if (!newFrame) |
181 return; | 180 return; |
182 newFrame->page()->setOpenedByDOM(); | |
183 if (shouldSendReferrer == MaybeSendReferrer) { | 181 if (shouldSendReferrer == MaybeSendReferrer) { |
184 newFrame->loader().setOpener(&openerFrame); | 182 newFrame->loader().setOpener(&openerFrame); |
185 newFrame->document()->setReferrerPolicy(openerFrame.document()->referrer
Policy()); | 183 newFrame->document()->setReferrerPolicy(openerFrame.document()->referrer
Policy()); |
186 } | 184 } |
187 FrameLoadRequest newRequest(0, request.resourceRequest()); | 185 FrameLoadRequest newRequest(0, request.resourceRequest()); |
188 newRequest.setFormState(request.formState()); | 186 newRequest.setFormState(request.formState()); |
189 newFrame->loader().load(newRequest); | 187 newFrame->loader().load(newRequest); |
190 } | 188 } |
191 | 189 |
192 } // namespace WebCore | 190 } // namespace WebCore |
OLD | NEW |