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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc

Issue 953053003: Context menu to view original image when Data Saver is being used. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2311
Patch Set: Created 5 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
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc
index 081c49f51c26d0f8f7b01d37b1d9fdd17739d8b7..534e60d547b4ea1b180cf60ae5bd5b8e694556ab 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.cc
@@ -47,6 +47,9 @@ bool IsEnabledOnCommandLine() {
namespace data_reduction_proxy {
+const char kDataReductionPassThroughHeader[] =
+ "X-PSA-Client-Options: v=1,m=1\nCache-Control: no-cache";
+
DataReductionProxySettings::DataReductionProxySettings()
: unreachable_(false),
allowed_(false),
@@ -110,10 +113,16 @@ void DataReductionProxySettings::SetOnDataReductionEnabledCallback(
on_data_reduction_proxy_enabled_.Run(IsDataReductionProxyEnabled());
}
-bool DataReductionProxySettings::IsDataReductionProxyEnabled() {
+bool DataReductionProxySettings::IsDataReductionProxyEnabled() const {
return spdy_proxy_auth_enabled_.GetValue() || IsEnabledOnCommandLine();
}
+bool DataReductionProxySettings::CanUseDataReductionProxy(
+ const GURL& url) const {
+ return url.is_valid() && url.scheme() == url::kHttpScheme &&
+ IsDataReductionProxyEnabled();
+}
+
bool
DataReductionProxySettings::IsDataReductionProxyAlternativeEnabled() const {
return data_reduction_proxy_alternative_enabled_.GetValue();

Powered by Google App Engine
This is Rietveld 408576698