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

Unified Diff: chrome/browser/plugins/flash_download_interception.cc

Issue 2820913002: Add another FlashDownloadInterceptionTest test case. (Closed)
Patch Set: check query Created 3 years, 8 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_unittest.cc » ('j') | 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 9a40a58334755121a859a346564d156c9ee63411..8b37e3cc2df496f888514e75404687bc4fe118fd 100644
--- a/chrome/browser/plugins/flash_download_interception.cc
+++ b/chrome/browser/plugins/flash_download_interception.cc
@@ -31,12 +31,16 @@ namespace {
// Regexes matching
const char kGetFlashURLCanonicalRegex[] = "(?i)get\\.adobe\\.com/.*flash.*";
-const char kGetFlashURLSecondaryRegex[] =
+const char kGetFlashURLSecondaryGoRegex[] =
"(?i)(www\\.)?(adobe|macromedia)\\.com/go/"
"((?i).*get[-_]?flash|getfp10android|.*fl(ash)player|.*flashpl|"
".*flash_player|flash_completion|flashpm|.*flashdownload|d65_flplayer|"
"fp_jp|runtimes_fp|[a-z_-]{3,6}h-m-a-?2|chrome|download_player|"
"gnav_fl|pdcredirect).*";
+const char kGetFlashURLSecondaryDownloadRegex[] =
+ "(?i)(www\\.)?(adobe|macromedia)\\.com/shockwave/download/download.cgi";
+const char kGetFlashURLSecondaryDownloadQuery[] =
+ "P1_Prod_Version=ShockwaveFlash";
void DoNothing(ContentSetting result) {}
@@ -107,7 +111,9 @@ bool FlashDownloadInterception::ShouldStopFlashDownloadAction(
std::string target_url_str =
target_url.ReplaceComponents(replacements).GetContent();
if (RE2::FullMatch(target_url_str, kGetFlashURLCanonicalRegex) ||
- RE2::FullMatch(target_url_str, kGetFlashURLSecondaryRegex)) {
+ RE2::FullMatch(target_url_str, kGetFlashURLSecondaryGoRegex) ||
+ (RE2::FullMatch(target_url_str, kGetFlashURLSecondaryDownloadRegex) &&
+ target_url.query() == kGetFlashURLSecondaryDownloadQuery)) {
ContentSetting flash_setting = PluginUtils::GetFlashPluginContentSetting(
host_content_settings_map, url::Origin(source_url), source_url,
nullptr);
« no previous file with comments | « no previous file | chrome/browser/plugins/flash_download_interception_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698