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

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

Issue 2811903002: [HBD] Tighten-up which adobe.com/go links are intercepted as Flash URLs (Closed)
Patch Set: fix 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 24c23ec37b90441a540397d3f79127e0bd60c064..9a40a58334755121a859a346564d156c9ee63411 100644
--- a/chrome/browser/plugins/flash_download_interception.cc
+++ b/chrome/browser/plugins/flash_download_interception.cc
@@ -32,9 +32,11 @@ namespace {
// Regexes matching
const char kGetFlashURLCanonicalRegex[] = "(?i)get\\.adobe\\.com/.*flash.*";
const char kGetFlashURLSecondaryRegex[] =
- "(?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).*";
+ "(?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).*";
void DoNothing(ContentSetting result) {}
@@ -89,12 +91,21 @@ bool FlashDownloadInterception::ShouldStopFlashDownloadAction(
if (!has_user_gesture)
return false;
+ url::Replacements<char> replacements;
+ replacements.ClearQuery();
+ replacements.ClearRef();
+ replacements.ClearUsername();
+ replacements.ClearPassword();
+
// If the navigation source is already the Flash download page, don't
// intercept the download. The user may be trying to download Flash.
- if (RE2::PartialMatch(source_url.GetContent(), kGetFlashURLCanonicalRegex))
+ std::string source_url_str =
+ source_url.ReplaceComponents(replacements).GetContent();
+ if (RE2::PartialMatch(source_url_str, kGetFlashURLCanonicalRegex))
return false;
- std::string target_url_str = target_url.GetContent();
+ std::string target_url_str =
+ target_url.ReplaceComponents(replacements).GetContent();
if (RE2::FullMatch(target_url_str, kGetFlashURLCanonicalRegex) ||
RE2::FullMatch(target_url_str, kGetFlashURLSecondaryRegex)) {
ContentSetting flash_setting = PluginUtils::GetFlashPluginContentSetting(
« 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