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

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

Issue 944533002: Context menu item to view original image when Data Saver is being used. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix merge. 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.h
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h
index f5b70a466c3a497dead6286b4ea8bdcb063d3254..06e1e6862a046634420f257459c1b88a339c1560 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_settings.h
@@ -29,6 +29,8 @@ class DataReductionProxyStatisticsPrefs;
// The number of days of bandwidth usage statistics that are tracked.
const unsigned int kNumDaysInHistory = 60;
+extern const char kDataReductionPassThroughHeader[];
Alexei Svitkine (slow) 2015/02/23 19:13:16 Add a comment.
Not at Google. Contact bengr 2015/02/23 20:38:59 Done.
+
// The number of days of bandwidth usage statistics that are presented.
const unsigned int kNumDaysInHistorySummary = 30;
@@ -74,7 +76,17 @@ class DataReductionProxySettings {
const base::Callback<void(bool)>& on_data_reduction_proxy_enabled);
// Returns true if the proxy is enabled.
- bool IsDataReductionProxyEnabled();
+ bool IsDataReductionProxyEnabled() const;
+
+ // Returns true if the proxy can be used for the given url. This method does
+ // not take into account the proxy config or proxy retry list, so it can
+ // return 'true' even when the proxy will not be used. Specifically, if
Alexei Svitkine (slow) 2015/02/23 19:13:16 Nit: Don't quote true. Either nothing around it, o
Not at Google. Contact bengr 2015/02/23 20:38:59 Done.
+ // another proxy configuration overrides use of data reduction proxy, or
+ // if data reduction proxy is in proxy retry list, then data reduction proxy
+ // will not be used, but this method will still return true. If this method
+ // returns false, then we are guaranteed that data reduction proxy will not be
+ // used.
+ bool CanUseDataReductionProxy(const GURL& url) const;
// Returns true if the alternative proxy is enabled.
bool IsDataReductionProxyAlternativeEnabled() const;
@@ -186,7 +198,8 @@ class DataReductionProxySettings {
FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
TestIsProxyEnabledOrManaged);
FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
- TestContentLengths);
+ TestCanUseDataReductionProxy);
+ FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest, TestContentLengths);
FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,
TestGetDailyContentLengths);
FRIEND_TEST_ALL_PREFIXES(DataReductionProxySettingsTest,

Powered by Google App Engine
This is Rietveld 408576698