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

Side by Side Diff: third_party/WebKit/Source/web/ChromeClientImpl.cpp

Issue 2159643002: Don't allow deferred frames to create new windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 5 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 | « no previous file | third_party/WebKit/Source/web/tests/ChromeClientImplTest.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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google 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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 } 351 }
352 352
353 } // namespace 353 } // namespace
354 354
355 Page* ChromeClientImpl::createWindow(LocalFrame* frame, const FrameLoadRequest& r, const WindowFeatures& features, 355 Page* ChromeClientImpl::createWindow(LocalFrame* frame, const FrameLoadRequest& r, const WindowFeatures& features,
356 NavigationPolicy navigationPolicy) 356 NavigationPolicy navigationPolicy)
357 { 357 {
358 if (!m_webView->client()) 358 if (!m_webView->client())
359 return nullptr; 359 return nullptr;
360 360
361 if (!frame->page() || frame->page()->defersLoading())
362 return nullptr;
363
361 WebNavigationPolicy policy = effectiveNavigationPolicy(navigationPolicy, fea tures); 364 WebNavigationPolicy policy = effectiveNavigationPolicy(navigationPolicy, fea tures);
362 DCHECK(frame->document()); 365 DCHECK(frame->document());
363 Fullscreen::fullyExitFullscreen(*frame->document()); 366 Fullscreen::fullyExitFullscreen(*frame->document());
364 367
365 WebViewImpl* newView = toWebViewImpl( 368 WebViewImpl* newView = toWebViewImpl(
366 m_webView->client()->createView(WebLocalFrameImpl::fromFrame(frame), Wra ppedResourceRequest(r.resourceRequest()), features, r.frameName(), policy, r.get ShouldSetOpener() == NeverSetOpener || features.noopener)); 369 m_webView->client()->createView(WebLocalFrameImpl::fromFrame(frame), Wra ppedResourceRequest(r.resourceRequest()), features, r.frameName(), policy, r.get ShouldSetOpener() == NeverSetOpener || features.noopener));
367 if (!newView) 370 if (!newView)
368 return nullptr; 371 return nullptr;
369 return newView->page(); 372 return newView->page();
370 } 373 }
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 { 1122 {
1120 return wrapUnique(m_webView->scheduler()->createFrameScheduler(blameContext) .release()); 1123 return wrapUnique(m_webView->scheduler()->createFrameScheduler(blameContext) .release());
1121 } 1124 }
1122 1125
1123 double ChromeClientImpl::lastFrameTimeMonotonic() const 1126 double ChromeClientImpl::lastFrameTimeMonotonic() const
1124 { 1127 {
1125 return m_webView->lastFrameTimeMonotonic(); 1128 return m_webView->lastFrameTimeMonotonic();
1126 } 1129 }
1127 1130
1128 } // namespace blink 1131 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/ChromeClientImplTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698