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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 if (!openerFrame.tree().top()->isLocalFrame()) | 69 if (!openerFrame.tree().top()->isLocalFrame()) |
70 return 0; | 70 return 0; |
71 return toLocalFrame(openerFrame.tree().top()); | 71 return toLocalFrame(openerFrame.tree().top()); |
72 } | 72 } |
73 | 73 |
74 Page* oldPage = openerFrame.page(); | 74 Page* oldPage = openerFrame.page(); |
75 if (!oldPage) | 75 if (!oldPage) |
76 return 0; | 76 return 0; |
77 | 77 |
78 Page* page = oldPage->chrome().client().createWindow(&openerFrame, request,
features, policy, shouldSendReferrer); | 78 Page* page = oldPage->chrome().client().createWindow(&openerFrame, request,
features, policy, shouldSendReferrer); |
79 if (!page) | 79 if (!page || !page->mainFrame()->isLocalFrame()) |
80 return 0; | 80 return 0; |
81 FrameHost* host = &page->frameHost(); | 81 FrameHost* host = &page->frameHost(); |
82 | 82 |
83 ASSERT(page->mainFrame()); | 83 ASSERT(page->mainFrame()); |
84 LocalFrame& frame = *page->mainFrame(); | 84 LocalFrame& frame = *page->deprecatedLocalMainFrame(); |
85 | 85 |
86 if (request.frameName() != "_blank") | 86 if (request.frameName() != "_blank") |
87 frame.tree().setName(request.frameName()); | 87 frame.tree().setName(request.frameName()); |
88 | 88 |
89 host->chrome().setWindowFeatures(features); | 89 host->chrome().setWindowFeatures(features); |
90 | 90 |
91 // 'x' and 'y' specify the location of the window, while 'width' and 'height
' | 91 // '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 | 92 // 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. | 93 // for the difference between the window size and the viewport size. |
94 | 94 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 if (shouldSendReferrer == MaybeSendReferrer) { | 183 if (shouldSendReferrer == MaybeSendReferrer) { |
184 newFrame->loader().setOpener(&openerFrame); | 184 newFrame->loader().setOpener(&openerFrame); |
185 newFrame->document()->setReferrerPolicy(openerFrame.document()->referrer
Policy()); | 185 newFrame->document()->setReferrerPolicy(openerFrame.document()->referrer
Policy()); |
186 } | 186 } |
187 FrameLoadRequest newRequest(0, request.resourceRequest()); | 187 FrameLoadRequest newRequest(0, request.resourceRequest()); |
188 newRequest.setFormState(request.formState()); | 188 newRequest.setFormState(request.formState()); |
189 newFrame->loader().load(newRequest); | 189 newFrame->loader().load(newRequest); |
190 } | 190 } |
191 | 191 |
192 } // namespace WebCore | 192 } // namespace WebCore |
OLD | NEW |