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

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
« no previous file with comments | « no previous file | chrome/browser/plugins/flash_download_interception.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c10195bcbb34828ad8edba2ce8273d2c01ec112c..affa99695a4e0fe9fa76d2f2d506d775c8ffd95b 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -629,6 +629,20 @@ void HandleBlockedPopupOnUIThread(const BlockedWindowParams& params) {
popup_helper->AddBlockedPopup(params);
}
+#if defined(ENABLE_PLUGINS)
+void HandleFlashDownloadActionOnUIThread(int render_process_id,
+ int render_frame_id) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ 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.
@@ -2283,7 +2297,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
« no previous file with comments | « no previous file | chrome/browser/plugins/flash_download_interception.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698