OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_SETTINGS_H_ | 5 #ifndef CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_SETTINGS_H_ |
6 #define CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_SETTINGS_H_ | 6 #define CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_SETTINGS_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 // Returns true if a screen promoting the data reduction proxy is allowed to | 69 // Returns true if a screen promoting the data reduction proxy is allowed to |
70 // be shown. Logic that decides when to show the promo should check its | 70 // be shown. Logic that decides when to show the promo should check its |
71 // availability. This would return false if not part of a separate field | 71 // availability. This would return false if not part of a separate field |
72 // trial that governs the use of the promotion. | 72 // trial that governs the use of the promotion. |
73 bool IsDataReductionProxyPromoAllowed(); | 73 bool IsDataReductionProxyPromoAllowed(); |
74 | 74 |
75 // Returns the URL of the data reduction proxy. | 75 // Returns the URL of the data reduction proxy. |
76 std::string GetDataReductionProxyOrigin(); | 76 std::string GetDataReductionProxyOrigin(); |
77 | 77 |
| 78 // Returns the URL of the fallback data reduction proxy. |
| 79 std::string GetDataReductionProxyFallback(); |
| 80 |
78 // Returns a configuration string for the proxy. | 81 // Returns a configuration string for the proxy. |
79 std::string GetDataReductionProxyAuth(); | 82 std::string GetDataReductionProxyAuth(); |
80 | 83 |
81 // Returns true if the proxy is enabled. | 84 // Returns true if the proxy is enabled. |
82 bool IsDataReductionProxyEnabled(); | 85 bool IsDataReductionProxyEnabled(); |
83 | 86 |
84 // Returns true if the proxy is managed by an adminstrator's policy. | 87 // Returns true if the proxy is managed by an adminstrator's policy. |
85 bool IsDataReductionProxyManaged(); | 88 bool IsDataReductionProxyManaged(); |
86 | 89 |
87 // Enables or disables the data reduction proxy. If a probe URL is available, | 90 // Enables or disables the data reduction proxy. If a probe URL is available, |
(...skipping 18 matching lines...) Expand all Loading... |
106 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; | 109 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
107 | 110 |
108 protected: | 111 protected: |
109 void InitPrefMembers(); | 112 void InitPrefMembers(); |
110 virtual net::URLFetcher* GetURLFetcher(); | 113 virtual net::URLFetcher* GetURLFetcher(); |
111 | 114 |
112 // Virtualized for unit test support. | 115 // Virtualized for unit test support. |
113 virtual PrefService* GetOriginalProfilePrefs(); | 116 virtual PrefService* GetOriginalProfilePrefs(); |
114 virtual PrefService* GetLocalStatePrefs(); | 117 virtual PrefService* GetLocalStatePrefs(); |
115 | 118 |
116 std::string GetDataReductionProxyOriginHostPort(); | |
117 | |
118 bool IsProxyOriginSetOnCommandLine(); | 119 bool IsProxyOriginSetOnCommandLine(); |
119 void GetContentLengths(unsigned int days, | 120 void GetContentLengths(unsigned int days, |
120 int64* original_content_length, | 121 int64* original_content_length, |
121 int64* received_content_length, | 122 int64* received_content_length, |
122 int64* last_update_time); | 123 int64* last_update_time); |
123 ContentLengthList GetDailyContentLengths(const char* pref_name); | 124 ContentLengthList GetDailyContentLengths(const char* pref_name); |
124 | 125 |
125 // Sets the proxy configs, enabling or disabling the proxy according to | 126 // Sets the proxy configs, enabling or disabling the proxy according to |
126 // the value of |enabled|. |at_startup| is true when this method is called | 127 // the value of |enabled|. |at_startup| is true when this method is called |
127 // from InitDataReductionProxySettings. | 128 // from InitDataReductionProxySettings. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 bool disabled_by_carrier_; | 199 bool disabled_by_carrier_; |
199 bool enabled_by_user_; | 200 bool enabled_by_user_; |
200 | 201 |
201 scoped_ptr<net::URLFetcher> fetcher_; | 202 scoped_ptr<net::URLFetcher> fetcher_; |
202 BooleanPrefMember spdy_proxy_auth_enabled_; | 203 BooleanPrefMember spdy_proxy_auth_enabled_; |
203 | 204 |
204 DISALLOW_COPY_AND_ASSIGN(DataReductionProxySettings); | 205 DISALLOW_COPY_AND_ASSIGN(DataReductionProxySettings); |
205 }; | 206 }; |
206 | 207 |
207 #endif // CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_SETTINGS_H_ | 208 #endif // CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_SETTINGS_H_ |
OLD | NEW |