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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2379833002: Hookup the window.open flash download interception to the permission prompt (Closed)
Patch Set: Hookup the window.open flash download interception to the permission prompt Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 7fe51b98a766693044495bfa3e3512dd4fe225e2..8c6b457f9505c29db991835744ead7b8813edc9f 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -625,6 +625,19 @@ void HandleBlockedPopupOnUIThread(const BlockedWindowParams& params) {
popup_helper->AddBlockedPopup(params);
}
+#if defined(ENABLE_PLUGINS)
+void HandleFlashDownloadActionOnUIThread(int render_process_id,
Lei Zhang 2016/09/30 01:22:46 DCHECK_CURRENTLY_ON(...)
raymes 2016/09/30 01:53:18 Done.
+ int render_frame_id) {
+ RenderFrameHost* render_frame_host =
+ RenderFrameHost::FromID(render_process_id, render_frame_id);
+ if (!render_frame_host)
+ return;
+ WebContents* web_contents =
+ WebContents::FromRenderFrameHost(render_frame_host);
+ FlashDownloadInterception::InterceptFlashDownloadNavigation(web_contents);
+}
+#endif // defined(ENABLE_PLUGINS)
+
// An implementation of the SSLCertReporter interface used by
// SSLErrorHandler. Uses the SafeBrowsing UI manager to send invalid
// certificate reports.
@@ -2279,7 +2292,10 @@ bool ChromeContentBrowserClient::CanCreateWindow(
if (FlashDownloadInterception::ShouldStopFlashDownloadAction(
content_settings, opener_top_level_frame_url, target_url,
user_gesture)) {
- // TODO(crbug.com/626728): Implement permission prompt logic.
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(&HandleFlashDownloadActionOnUIThread, render_process_id,
+ opener_render_frame_id));
return false;
}
#endif

Powered by Google App Engine
This is Rietveld 408576698