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

Unified Diff: chrome/browser/plugins/flash_download_interception.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 | « chrome/browser/plugins/flash_download_interception.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugins/flash_download_interception.cc
diff --git a/chrome/browser/plugins/flash_download_interception.cc b/chrome/browser/plugins/flash_download_interception.cc
index 7c2d8118ed8b869d9d63a2492d18a2a8a1b00503..032830b00999ce6cfd7fb95810afb94b6675123b 100644
--- a/chrome/browser/plugins/flash_download_interception.cc
+++ b/chrome/browser/plugins/flash_download_interception.cc
@@ -31,21 +31,26 @@ const char kFlashDownloadURL[] = "get.adobe.com/flash";
void DoNothing(blink::mojom::PermissionStatus result) {}
-bool ShouldInterceptNavigation(
+bool InterceptNavigation(
content::WebContents* source,
const navigation_interception::NavigationParams& params) {
+ FlashDownloadInterception::InterceptFlashDownloadNavigation(source);
+ return true;
+}
+
+} // namespace
+
+// static
+void FlashDownloadInterception::InterceptFlashDownloadNavigation(
+ content::WebContents* source) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
PermissionManager* manager = PermissionManager::Get(
Profile::FromBrowserContext(source->GetBrowserContext()));
manager->RequestPermission(
content::PermissionType::FLASH, source->GetMainFrame(),
source->GetLastCommittedURL(), true, base::Bind(&DoNothing));
-
- return true;
}
-} // namespace
-
// static
bool FlashDownloadInterception::ShouldStopFlashDownloadAction(
HostContentSettingsMap* host_content_settings_map,
@@ -92,5 +97,5 @@ FlashDownloadInterception::MaybeCreateThrottleFor(NavigationHandle* handle) {
}
return base::MakeUnique<navigation_interception::InterceptNavigationThrottle>(
- handle, base::Bind(&ShouldInterceptNavigation), true);
+ handle, base::Bind(&InterceptNavigation), true);
}
« no previous file with comments | « chrome/browser/plugins/flash_download_interception.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698