| 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 CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_ | 5 #ifndef CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_ |
| 6 #define CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_ | 6 #define CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" | 9 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" |
| 10 #include "components/keyed_service/core/keyed_service.h" | 10 #include "components/keyed_service/core/keyed_service.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 virtual ~DataReductionProxyChromeSettings(); | 39 virtual ~DataReductionProxyChromeSettings(); |
| 40 | 40 |
| 41 // Initialize the settings object with the given configurator, prefs services, | 41 // Initialize the settings object with the given configurator, prefs services, |
| 42 // and request context. | 42 // and request context. |
| 43 void InitDataReductionProxySettings( | 43 void InitDataReductionProxySettings( |
| 44 data_reduction_proxy::DataReductionProxyConfigurator* configurator, | 44 data_reduction_proxy::DataReductionProxyConfigurator* configurator, |
| 45 PrefService* profile_prefs, | 45 PrefService* profile_prefs, |
| 46 PrefService* local_state_prefs, | 46 PrefService* local_state_prefs, |
| 47 net::URLRequestContextGetter* request_context); | 47 net::URLRequestContextGetter* request_context); |
| 48 | 48 |
| 49 // Using the chrome::VersionInfo version, returns the build and patch portion | 49 // Using the chrome::VersionInfo version, returns the build number of the |
| 50 // of the string delimited by a period. If the chrome::VersionInfo version | 50 // chrome version. If the chrome::VersionInfo version isn't of the form |
| 51 // isn't of the form xx.xx.xx.xx returns an empty string. | 51 // xx.xx.xx.xx returns an empty string. |
| 52 static std::string GetBuildAndPatchNumber(); | 52 static std::string GetBuildNumber(); |
| 53 |
| 54 // Using the chrome::VersionInfo version, returns the patch number of the |
| 55 // chrome version. If the chrome::VersionInfo version isn't of the form |
| 56 // xx.xx.xx.xx returns an empty string. |
| 57 static std::string GetPatchNumber(); |
| 53 | 58 |
| 54 // Gets the client type for the data reduction proxy. | 59 // Gets the client type for the data reduction proxy. |
| 55 static std::string GetClient(); | 60 static std::string GetClient(); |
| 56 | 61 |
| 57 private: | 62 private: |
| 63 FRIEND_TEST_ALL_PREFIXES(DataReductionProxyChromeSettingsTest, |
| 64 TestGetBuildNumber); |
| 65 FRIEND_TEST_ALL_PREFIXES(DataReductionProxyChromeSettingsTest, |
| 66 TestGetPatchNumber); |
| 67 |
| 58 // Registers the DataReductionProxyEnabled synthetic field trial with | 68 // Registers the DataReductionProxyEnabled synthetic field trial with |
| 59 // the group |data_reduction_proxy_enabled|. | 69 // the group |data_reduction_proxy_enabled|. |
| 60 void RegisterSyntheticFieldTrial(bool data_reduction_proxy_enabled); | 70 void RegisterSyntheticFieldTrial(bool data_reduction_proxy_enabled); |
| 61 | 71 |
| 72 // Using |version|, returns the build number of the string. If |version| |
| 73 // isn't of the form xx.xx.xx.xx returns an empty string. |
| 74 static std::string GetBuildNumberFromString(std::string version); |
| 75 |
| 76 // Using |version|, returns the patch number of the string. If |version| |
| 77 // isn't of the form xx.xx.xx.xx returns an empty string. |
| 78 static std::string GetPatchNumberFromString(std::string version); |
| 79 |
| 62 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyChromeSettings); | 80 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyChromeSettings); |
| 63 }; | 81 }; |
| 64 | 82 |
| 65 #endif // CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_ | 83 #endif // CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_SETTINGS_H_ |
| OLD | NEW |