| 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 f46a1e06c0e14a572f3e8bf93f15d31ff2255812..d82d35803252c608df4375f377cdbea4d5eba2de 100644
|
| --- a/chrome/browser/plugins/flash_download_interception.cc
|
| +++ b/chrome/browser/plugins/flash_download_interception.cc
|
| @@ -31,10 +31,12 @@ namespace {
|
|
|
| // Regexes matching
|
| const char kGetFlashURLCanonicalRegex[] = "(?i)get\\.adobe\\.com/.*flash.*";
|
| -const char kGetFlashURLSecondaryRegex[] =
|
| +const char kGetFlashURLGoLinkRegex[] =
|
| "(?i)(www\\.)?(adobe|macromedia)\\.com/go.*"
|
| "(get[-_]?flash|fl(ash)?.?pl(ayer)?|flash_completion|flashpm|flashdownload|"
|
| "fp|h-m-a-?2|chrome|download_player|gnav_fl|pdcredirect).*";
|
| +const char kGetFlashURLShockwaveRegex[] =
|
| + "(?i)(www\\.)?(adobe)\\.com/shockwave/download.*";
|
|
|
| void DoNothing(blink::mojom::PermissionStatus result) {}
|
|
|
| @@ -65,6 +67,7 @@ void FlashDownloadInterception::InterceptFlashDownloadNavigation(
|
| host_content_settings_map, CONTENT_SETTINGS_TYPE_PLUGINS, flash_setting);
|
|
|
| if (flash_setting == CONTENT_SETTING_DETECT_IMPORTANT_CONTENT) {
|
| + printf("Requesting permission...\n");
|
| PermissionManager* manager = PermissionManager::Get(profile);
|
| manager->RequestPermission(
|
| content::PermissionType::FLASH, web_contents->GetMainFrame(),
|
| @@ -95,8 +98,10 @@ bool FlashDownloadInterception::ShouldStopFlashDownloadAction(
|
| return false;
|
|
|
| std::string target_url_str = target_url.GetContent();
|
| + printf("target url: %s\n", target_url_str.c_str());
|
| if (RE2::FullMatch(target_url_str, kGetFlashURLCanonicalRegex) ||
|
| - RE2::FullMatch(target_url_str, kGetFlashURLSecondaryRegex)) {
|
| + RE2::FullMatch(target_url_str, kGetFlashURLGoLinkRegex) ||
|
| + RE2::FullMatch(target_url_str, kGetFlashURLShockwaveRegex)) {
|
| ContentSetting flash_setting = PluginUtils::GetFlashPluginContentSetting(
|
| host_content_settings_map, url::Origin(source_url), source_url,
|
| nullptr);
|
| @@ -121,6 +126,11 @@ FlashDownloadInterception::MaybeCreateThrottleFor(NavigationHandle* handle) {
|
| if (!handle->IsRendererInitiated())
|
| return nullptr;
|
|
|
| + printf("Src url: %s target: %s, has gesture %d, main frame %d\n",
|
| + handle->GetWebContents()->GetLastCommittedURL().spec().c_str(),
|
| + handle->GetURL().spec().c_str(),
|
| + handle->HasUserGesture(), handle->IsInMainFrame());
|
| +
|
| // The source URL may be empty, it's a new tab. Intercepting that navigation
|
| // would lead to a blank new tab, which would be bad.
|
| GURL source_url = handle->GetWebContents()->GetLastCommittedURL();
|
| @@ -141,6 +151,7 @@ FlashDownloadInterception::MaybeCreateThrottleFor(NavigationHandle* handle) {
|
| return nullptr;
|
| }
|
|
|
| + printf("making nav throttle\n");
|
| return base::MakeUnique<navigation_interception::InterceptNavigationThrottle>(
|
| handle, base::Bind(&InterceptNavigation, source_url), true);
|
| }
|
|
|