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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 return &frame; | 123 return &frame; |
124 } | 124 } |
125 | 125 |
126 static Frame* CreateWindowHelper(LocalFrame& opener_frame, | 126 static Frame* CreateWindowHelper(LocalFrame& opener_frame, |
127 LocalFrame& active_frame, | 127 LocalFrame& active_frame, |
128 LocalFrame& lookup_frame, | 128 LocalFrame& lookup_frame, |
129 const FrameLoadRequest& request, | 129 const FrameLoadRequest& request, |
130 const WindowFeatures& features, | 130 const WindowFeatures& features, |
131 NavigationPolicy policy, | 131 NavigationPolicy policy, |
132 bool& created) { | 132 bool& created) { |
133 ASSERT(!features.dialog || request.FrameName().IsEmpty()); | 133 DCHECK(!features.dialog || request.FrameName().IsEmpty()); |
134 ASSERT(request.GetResourceRequest().RequestorOrigin() || | 134 DCHECK(request.GetResourceRequest().RequestorOrigin() || |
135 opener_frame.GetDocument()->Url().IsEmpty()); | 135 opener_frame.GetDocument()->Url().IsEmpty()); |
136 ASSERT(request.GetResourceRequest().GetFrameType() == | 136 DCHECK_EQ(request.GetResourceRequest().GetFrameType(), |
137 WebURLRequest::kFrameTypeAuxiliary); | 137 WebURLRequest::kFrameTypeAuxiliary); |
138 | 138 |
139 created = false; | 139 created = false; |
140 | 140 |
141 Frame* window = features.noopener | 141 Frame* window = features.noopener |
142 ? nullptr | 142 ? nullptr |
143 : ReuseExistingWindow(active_frame, lookup_frame, | 143 : ReuseExistingWindow(active_frame, lookup_frame, |
144 request.FrameName(), policy); | 144 request.FrameName(), policy); |
145 | 145 |
146 if (!window) { | 146 if (!window) { |
147 // Sandboxed frames cannot open new auxiliary browsing contexts. | 147 // Sandboxed frames cannot open new auxiliary browsing contexts. |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 new_frame->Navigate(*calling_window.document(), completed_url, false, | 252 new_frame->Navigate(*calling_window.document(), completed_url, false, |
253 has_user_gesture ? UserGestureStatus::kActive | 253 has_user_gesture ? UserGestureStatus::kActive |
254 : UserGestureStatus::kNone); | 254 : UserGestureStatus::kNone); |
255 } | 255 } |
256 return new_frame->DomWindow(); | 256 return new_frame->DomWindow(); |
257 } | 257 } |
258 | 258 |
259 void CreateWindowForRequest(const FrameLoadRequest& request, | 259 void CreateWindowForRequest(const FrameLoadRequest& request, |
260 LocalFrame& opener_frame, | 260 LocalFrame& opener_frame, |
261 NavigationPolicy policy) { | 261 NavigationPolicy policy) { |
262 ASSERT(request.GetResourceRequest().RequestorOrigin() || | 262 DCHECK(request.GetResourceRequest().RequestorOrigin() || |
263 (opener_frame.GetDocument() && | 263 (opener_frame.GetDocument() && |
264 opener_frame.GetDocument()->Url().IsEmpty())); | 264 opener_frame.GetDocument()->Url().IsEmpty())); |
265 | 265 |
266 if (opener_frame.GetDocument()->PageDismissalEventBeingDispatched() != | 266 if (opener_frame.GetDocument()->PageDismissalEventBeingDispatched() != |
267 Document::kNoDismissal) | 267 Document::kNoDismissal) |
268 return; | 268 return; |
269 | 269 |
270 if (opener_frame.GetDocument() && | 270 if (opener_frame.GetDocument() && |
271 opener_frame.GetDocument()->IsSandboxed(kSandboxPopups)) | 271 opener_frame.GetDocument()->IsSandboxed(kSandboxPopups)) |
272 return; | 272 return; |
(...skipping 20 matching lines...) Expand all Loading... |
293 } | 293 } |
294 | 294 |
295 // TODO(japhet): Form submissions on RemoteFrames don't work yet. | 295 // TODO(japhet): Form submissions on RemoteFrames don't work yet. |
296 FrameLoadRequest new_request(0, request.GetResourceRequest()); | 296 FrameLoadRequest new_request(0, request.GetResourceRequest()); |
297 new_request.SetForm(request.Form()); | 297 new_request.SetForm(request.Form()); |
298 if (new_frame->IsLocalFrame()) | 298 if (new_frame->IsLocalFrame()) |
299 ToLocalFrame(new_frame)->Loader().Load(new_request); | 299 ToLocalFrame(new_frame)->Loader().Load(new_request); |
300 } | 300 } |
301 | 301 |
302 } // namespace blink | 302 } // namespace blink |
OLD | NEW |