Index: chrome/browser/android/intercept_download_resource_throttle.cc |
diff --git a/chrome/browser/android/intercept_download_resource_throttle.cc b/chrome/browser/android/intercept_download_resource_throttle.cc |
index 1592233f81895c4a8ad36a5e77f949d2378b0100..4f5662fa13f0afc3063a4d1087bd63476739a4bd 100644 |
--- a/chrome/browser/android/intercept_download_resource_throttle.cc |
+++ b/chrome/browser/android/intercept_download_resource_throttle.cc |
@@ -4,7 +4,9 @@ |
#include "chrome/browser/android/intercept_download_resource_throttle.h" |
+#include "base/feature_list.h" |
#include "base/metrics/histogram_macros.h" |
+#include "chrome/browser/android/chrome_feature_list.h" |
#include "components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h" |
#include "content/public/browser/android/download_controller_android.h" |
#include "content/public/browser/resource_controller.h" |
@@ -41,6 +43,11 @@ void RecordInterceptFailureReasons( |
namespace chrome { |
+// static |
+bool InterceptDownloadResourceThrottle::IsDownloadInterceptionEnabled() { |
+ return base::FeatureList::IsEnabled(chrome::android::kSystemDownloadManager); |
+} |
+ |
InterceptDownloadResourceThrottle::InterceptDownloadResourceThrottle( |
net::URLRequest* request, |
int render_process_id, |
@@ -64,6 +71,9 @@ const char* InterceptDownloadResourceThrottle::GetNameForLogging() const { |
} |
void InterceptDownloadResourceThrottle::ProcessDownloadRequest() { |
+ if (!IsDownloadInterceptionEnabled()) |
+ return; |
+ |
if (request_->url_chain().empty()) { |
RecordInterceptFailureReasons(EMPTY_URL); |
return; |