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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2272123002: [HBD] Intercept navigation to Flash download page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 49f9dff09fcfc916180f8743e78d5de5c031740f..ed7102a105fa6abe6fada71226f7fec7f35651d0 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -59,6 +59,7 @@
#include "chrome/browser/password_manager/chrome_password_manager_client.h"
#include "chrome/browser/permissions/permission_context_base.h"
#include "chrome/browser/platform_util.h"
+#include "chrome/browser/plugins/flash_download_interception.h"
tommycli 2016/08/24 19:11:30 These new includes should also be in the ENABLE_PL
trizzofo 2016/08/24 22:45:13 Done.
#include "chrome/browser/prerender/prerender_final_status.h"
#include "chrome/browser/prerender/prerender_manager.h"
#include "chrome/browser/prerender/prerender_manager_factory.h"
@@ -98,6 +99,7 @@
#include "chrome/browser/usb/usb_tab_helper.h"
#include "chrome/common/channel_info.h"
#include "chrome/common/chrome_constants.h"
+#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/env_vars.h"
@@ -3014,6 +3016,14 @@ ScopedVector<content::NavigationThrottle>
ChromeContentBrowserClient::CreateThrottlesForNavigation(
content::NavigationHandle* handle) {
ScopedVector<content::NavigationThrottle> throttles;
+
+ if (base::FeatureList::IsEnabled(features::kPreferHtmlOverPlugins)) {
tommycli 2016/08/24 19:11:30 This should only happen if it's a main frame navig
trizzofo 2016/08/24 22:45:13 Done.
+ std::unique_ptr<content::NavigationThrottle> flash_url_throttle =
+ FlashDownloadInterception::MaybeCreateThrottleFor(handle);
+ if (flash_url_throttle)
+ throttles.push_back(std::move(flash_url_throttle));
+ }
+
if (handle->IsInMainFrame()) {
throttles.push_back(
page_load_metrics::MetricsNavigationThrottle::Create(handle));

Powered by Google App Engine
This is Rietveld 408576698