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

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

Issue 799923006: Make canNavigate() OOPI-friendly (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years 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 | Annotate | Revision Log
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« Source/core/loader/FrameLoader.cpp ('K') | « Source/core/loader/FrameLoader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698