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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 kSecurityMessageSource, kErrorMessageLevel, | 151 kSecurityMessageSource, kErrorMessageLevel, |
152 "Blocked opening '" + | 152 "Blocked opening '" + |
153 request.GetResourceRequest().Url().ElidedString() + | 153 request.GetResourceRequest().Url().ElidedString() + |
154 "' in a new window because the request was made in a sandboxed " | 154 "' in a new window because the request was made in a sandboxed " |
155 "frame whose 'allow-popups' permission is not set.")); | 155 "frame whose 'allow-popups' permission is not set.")); |
156 return nullptr; | 156 return nullptr; |
157 } | 157 } |
158 | 158 |
159 if (opener_frame.GetSettings() && | 159 if (opener_frame.GetSettings() && |
160 !opener_frame.GetSettings()->GetSupportsMultipleWindows()) | 160 !opener_frame.GetSettings()->GetSupportsMultipleWindows()) |
161 window = opener_frame.Tree().Top(); | 161 window = &opener_frame.Tree().Top(); |
162 } | 162 } |
163 | 163 |
164 if (window) { | 164 if (window) { |
165 // JS can run inside reuseExistingWindow (via onblur), which can detach | 165 // JS can run inside reuseExistingWindow (via onblur), which can detach |
166 // the target window. | 166 // the target window. |
167 if (!window->Client()) | 167 if (!window->Client()) |
168 return nullptr; | 168 return nullptr; |
169 if (request.GetShouldSetOpener() == kMaybeSetOpener) | 169 if (request.GetShouldSetOpener() == kMaybeSetOpener) |
170 window->Client()->SetOpener(&opener_frame); | 170 window->Client()->SetOpener(&opener_frame); |
171 return window; | 171 return window; |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 } | 292 } |
293 | 293 |
294 // TODO(japhet): Form submissions on RemoteFrames don't work yet. | 294 // TODO(japhet): Form submissions on RemoteFrames don't work yet. |
295 FrameLoadRequest new_request(0, request.GetResourceRequest()); | 295 FrameLoadRequest new_request(0, request.GetResourceRequest()); |
296 new_request.SetForm(request.Form()); | 296 new_request.SetForm(request.Form()); |
297 if (new_frame->IsLocalFrame()) | 297 if (new_frame->IsLocalFrame()) |
298 ToLocalFrame(new_frame)->Loader().Load(new_request); | 298 ToLocalFrame(new_frame)->Loader().Load(new_request); |
299 } | 299 } |
300 | 300 |
301 } // namespace blink | 301 } // namespace blink |
OLD | NEW |