Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: Source/core/page/CreateWindow.cpp

Issue 302213002: Convert page-level classes to handle RemoteFrames from FrameTree (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: bug fix Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/page/Chrome.cpp ('k') | Source/core/page/EventHandler.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 // Sandboxed frames cannot open new auxiliary browsing contexts. 60 // Sandboxed frames cannot open new auxiliary browsing contexts.
61 if (openerFrame.document()->isSandboxed(SandboxPopups)) { 61 if (openerFrame.document()->isSandboxed(SandboxPopups)) {
62 // FIXME: This message should be moved off the console once a solution t o https://bugs.webkit.org/show_bug.cgi?id=103274 exists. 62 // 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 openerFrame.document()->addConsoleMessage(SecurityMessageSource, ErrorMe ssageLevel, "Blocked opening '" + request.resourceRequest().url().elidedString() + "' in a new window because the request was made in a sandboxed frame whose 'a llow-popups' permission is not set."); 63 openerFrame.document()->addConsoleMessage(SecurityMessageSource, ErrorMe ssageLevel, "Blocked opening '" + request.resourceRequest().url().elidedString() + "' in a new window because the request was made in a sandboxed frame whose 'a llow-popups' permission is not set.");
64 return 0; 64 return 0;
65 } 65 }
66 66
67 if (openerFrame.settings() && !openerFrame.settings()->supportsMultipleWindo ws()) { 67 if (openerFrame.settings() && !openerFrame.settings()->supportsMultipleWindo ws()) {
68 created = false; 68 created = false;
69 if (!openerFrame.tree().top()->isLocalFrame())
70 return 0;
69 return openerFrame.tree().top(); 71 return openerFrame.tree().top();
70 } 72 }
71 73
72 Page* oldPage = openerFrame.page(); 74 Page* oldPage = openerFrame.page();
73 if (!oldPage) 75 if (!oldPage)
74 return 0; 76 return 0;
75 77
76 Page* page = oldPage->chrome().client().createWindow(&openerFrame, request, features, policy, shouldSendReferrer); 78 Page* page = oldPage->chrome().client().createWindow(&openerFrame, request, features, policy, shouldSendReferrer);
77 if (!page) 79 if (!page)
78 return 0; 80 return 0;
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 if (shouldSendReferrer == MaybeSendReferrer) { 183 if (shouldSendReferrer == MaybeSendReferrer) {
182 newFrame->loader().setOpener(&openerFrame); 184 newFrame->loader().setOpener(&openerFrame);
183 newFrame->document()->setReferrerPolicy(openerFrame.document()->referrer Policy()); 185 newFrame->document()->setReferrerPolicy(openerFrame.document()->referrer Policy());
184 } 186 }
185 FrameLoadRequest newRequest(0, request.resourceRequest()); 187 FrameLoadRequest newRequest(0, request.resourceRequest());
186 newRequest.setFormState(request.formState()); 188 newRequest.setFormState(request.formState());
187 newFrame->loader().load(newRequest); 189 newFrame->loader().load(newRequest);
188 } 190 }
189 191
190 } // namespace WebCore 192 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/Chrome.cpp ('k') | Source/core/page/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698