Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H_ | 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H_ |
| 6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H_ | 6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 | 171 |
| 172 // Given |allowed_|, |fallback_allowed_|, and |alt_allowed_|, returns the | 172 // Given |allowed_|, |fallback_allowed_|, and |alt_allowed_|, returns the |
| 173 // list of data reduction proxies that may be used. | 173 // list of data reduction proxies that may be used. |
| 174 DataReductionProxyList GetAllowedProxies() const; | 174 DataReductionProxyList GetAllowedProxies() const; |
| 175 | 175 |
| 176 // Returns true if any proxy origins are set on the command line. | 176 // Returns true if any proxy origins are set on the command line. |
| 177 bool is_configured_on_command_line() const { | 177 bool is_configured_on_command_line() const { |
| 178 return configured_on_command_line_; | 178 return configured_on_command_line_; |
| 179 } | 179 } |
| 180 | 180 |
| 181 // Returns the corresponding string from preprocessor constants if defined, | |
| 182 // and an empty string otherwise. | |
| 183 virtual std::string GetDefaultDevOrigin() const; | |
|
bengr
2014/07/18 19:41:44
These shouldn't be public.
Not at Google. Contact bengr
2014/07/21 17:46:25
We need to access this from io_thread.cc for now.
| |
| 184 virtual std::string GetDefaultOrigin() const; | |
| 185 virtual std::string GetDefaultFallbackOrigin() const; | |
| 186 virtual std::string GetDefaultSSLOrigin() const; | |
| 187 virtual std::string GetDefaultAltOrigin() const; | |
| 188 virtual std::string GetDefaultAltFallbackOrigin() const; | |
| 189 virtual std::string GetDefaultProbeURL() const; | |
| 190 virtual std::string GetDefaultWarmupURL() const; | |
| 191 | |
| 181 protected: | 192 protected: |
| 182 // Test constructor that optionally won't call Init(); | 193 // Test constructor that optionally won't call Init(); |
| 183 DataReductionProxyParams(int flags, | 194 DataReductionProxyParams(int flags, |
| 184 bool should_call_init); | 195 bool should_call_init); |
| 185 | 196 |
| 186 // Initialize the values of the proxies, and probe URL, from command | 197 // Initialize the values of the proxies, and probe URL, from command |
| 187 // line flags and preprocessor constants, and check that there are | 198 // line flags and preprocessor constants, and check that there are |
| 188 // corresponding definitions for the allowed configurations. | 199 // corresponding definitions for the allowed configurations. |
| 189 bool Init(bool allowed, bool fallback_allowed, bool alt_allowed); | 200 bool Init(bool allowed, bool fallback_allowed, bool alt_allowed); |
| 190 | 201 |
| 191 // Initialize the values of the proxies, and probe URL from command | 202 // Initialize the values of the proxies, and probe URL from command |
| 192 // line flags and preprocessor constants. | 203 // line flags and preprocessor constants. |
| 193 void InitWithoutChecks(); | 204 void InitWithoutChecks(); |
| 194 | 205 |
| 195 // Returns the corresponding string from preprocessor constants if defined, | |
| 196 // and an empty string otherwise. | |
| 197 virtual std::string GetDefaultDevOrigin() const; | |
| 198 virtual std::string GetDefaultOrigin() const; | |
| 199 virtual std::string GetDefaultFallbackOrigin() const; | |
| 200 virtual std::string GetDefaultSSLOrigin() const; | |
| 201 virtual std::string GetDefaultAltOrigin() const; | |
| 202 virtual std::string GetDefaultAltFallbackOrigin() const; | |
| 203 virtual std::string GetDefaultProbeURL() const; | |
| 204 virtual std::string GetDefaultWarmupURL() const; | |
| 205 | |
| 206 private: | 206 private: |
| 207 GURL origin_; | 207 GURL origin_; |
| 208 GURL fallback_origin_; | 208 GURL fallback_origin_; |
| 209 GURL ssl_origin_; | 209 GURL ssl_origin_; |
| 210 GURL alt_origin_; | 210 GURL alt_origin_; |
| 211 GURL alt_fallback_origin_; | 211 GURL alt_fallback_origin_; |
| 212 GURL probe_url_; | 212 GURL probe_url_; |
| 213 GURL warmup_url_; | 213 GURL warmup_url_; |
| 214 | 214 |
| 215 bool allowed_; | 215 bool allowed_; |
| 216 const bool fallback_allowed_; | 216 const bool fallback_allowed_; |
| 217 bool alt_allowed_; | 217 bool alt_allowed_; |
| 218 const bool promo_allowed_; | 218 const bool promo_allowed_; |
| 219 bool holdback_; | 219 bool holdback_; |
| 220 | 220 |
| 221 bool configured_on_command_line_; | 221 bool configured_on_command_line_; |
| 222 | 222 |
| 223 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyParams); | 223 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyParams); |
| 224 }; | 224 }; |
| 225 | 225 |
| 226 } // namespace data_reduction_proxy | 226 } // namespace data_reduction_proxy |
| 227 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H _ | 227 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_PARAMS_H _ |
| OLD | NEW |