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

Unified Diff: chrome/browser/android/intercept_download_resource_throttle.cc

Issue 1692693003: add a flag to enable/disable download interception on android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unused variable Created 4 years, 10 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 | « chrome/browser/android/intercept_download_resource_throttle.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « chrome/browser/android/intercept_download_resource_throttle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698