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

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

Issue 2435933002: Don't intercept Flash navigations when the current page is the Flash download page. (Closed)
Patch Set: Don't intercept Flash navigations when the current page is the Flash download page. Created 4 years, 2 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 12cef544843eb52b713dcf1756940c2f4e96fc66..22166066e38b94c0912b7369b9d097f5442bba60 100644
--- a/chrome/browser/plugins/flash_download_interception.cc
+++ b/chrome/browser/plugins/flash_download_interception.cc
@@ -31,9 +31,13 @@ namespace {
const char kWwwPrefix[] = "www.";
-// URLs that will be intercepted with any www. prefix pruned.
+// The URL of the page where Flash can be downloaded.
+const char kFlashDownloadURL[] = "get.adobe.com/flash";
+
+// URLs that will be intercepted with any www. prefix pruned. These should all
+// redirect to |kFlashDownloadURL|.
const char* kFlashDownloadURLs[] = {
- "get.adobe.com/flash", "macromedia.com/go/getflashplayer",
+ kFlashDownloadURL, "macromedia.com/go/getflashplayer",
"adobe.com/go/getflashplayer", "adobe.com/go/gntray_dl_getflashplayer"};
void DoNothing(blink::mojom::PermissionStatus result) {}
@@ -89,6 +93,13 @@ bool FlashDownloadInterception::ShouldStopFlashDownloadAction(
if (!has_user_gesture)
return false;
+ // If the navigation source is already the Flash download page, don't
+ // intercept the download. The user may be trying to download Flash.
+ if (base::StartsWith(source_url.GetContent(), kFlashDownloadURL,
+ base::CompareCase::INSENSITIVE_ASCII)) {
+ return false;
+ }
+
std::string target_url_str = target_url.GetContent();
// Ignore www. if it's at the start of the URL.
if (base::StartsWith(target_url_str, kWwwPrefix,
« 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