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

Unified Diff: Source/web/ChromeClientImpl.cpp

Issue 730013002: Disallow background tabs without matching user gesture for createWindow() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/ChromeClientImpl.cpp
diff --git a/Source/web/ChromeClientImpl.cpp b/Source/web/ChromeClientImpl.cpp
index 7f830af351ba6b6c08bf57d22878c32c0668bd65..722b5cca37e14947d43b66a449e204d64daae56d 100644
--- a/Source/web/ChromeClientImpl.cpp
+++ b/Source/web/ChromeClientImpl.cpp
@@ -229,6 +229,8 @@ Page* ChromeClientImpl::createWindow(LocalFrame* frame, const FrameLoadRequest&
WebNavigationPolicy policy = static_cast<WebNavigationPolicy>(navigationPolicy);
if (policy == WebNavigationPolicyIgnore)
policy = getNavigationPolicy();
+ else if (policy == WebNavigationPolicyNewBackgroundTab && getNavigationPolicy() != WebNavigationPolicyNewBackgroundTab)
+ policy = WebNavigationPolicyNewForegroundTab;
ASSERT(frame->document());
Fullscreen::fullyExitFullscreen(*frame->document());
@@ -301,6 +303,8 @@ void ChromeClientImpl::show(NavigationPolicy navigationPolicy)
WebNavigationPolicy policy = static_cast<WebNavigationPolicy>(navigationPolicy);
if (policy == WebNavigationPolicyIgnore)
policy = getNavigationPolicy();
+ else if (policy == WebNavigationPolicyNewBackgroundTab && getNavigationPolicy() != WebNavigationPolicyNewBackgroundTab)
+ policy = WebNavigationPolicyNewForegroundTab;
Mike West 2014/11/17 09:43:32 Nit: Maybe extract this out to a helper so you don
m_webView->client()->show(policy);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698