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 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | 5 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
6 | 6 |
7 #include "base/strings/string_split.h" | |
7 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator. h" | 9 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator. h" |
9 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/profiles/profile_manager.h" | 11 #include "chrome/browser/profiles/profile_manager.h" |
11 #include "components/data_reduction_proxy/browser/data_reduction_proxy_configura tor.h" | 12 #include "components/data_reduction_proxy/browser/data_reduction_proxy_configura tor.h" |
12 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" | 13 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" |
13 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h" | 14 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h" |
14 | 15 |
15 using data_reduction_proxy::DataReductionProxyParams; | 16 using data_reduction_proxy::DataReductionProxyParams; |
16 using data_reduction_proxy::DataReductionProxySettings; | 17 using data_reduction_proxy::DataReductionProxySettings; |
(...skipping 14 matching lines...) Expand all Loading... | |
31 configurator(new DataReductionProxyChromeConfigurator(prefs)); | 32 configurator(new DataReductionProxyChromeConfigurator(prefs)); |
32 SetProxyConfigurator(configurator.Pass()); | 33 SetProxyConfigurator(configurator.Pass()); |
33 DataReductionProxySettings::InitDataReductionProxySettings( | 34 DataReductionProxySettings::InitDataReductionProxySettings( |
34 prefs, | 35 prefs, |
35 g_browser_process->local_state(), | 36 g_browser_process->local_state(), |
36 ProfileManager::GetActiveUserProfile()->GetRequestContext()); | 37 ProfileManager::GetActiveUserProfile()->GetRequestContext()); |
37 | 38 |
38 SetDataReductionProxyAlternativeEnabled( | 39 SetDataReductionProxyAlternativeEnabled( |
39 DataReductionProxyParams::IsIncludedInAlternativeFieldTrial()); | 40 DataReductionProxyParams::IsIncludedInAlternativeFieldTrial()); |
40 } | 41 } |
42 | |
43 // static | |
44 std::string DataReductionProxyChromeSettings::GetBuildAndPatchNumber( | |
45 const std::string& version) { | |
46 std::vector<std::string> version_parts; | |
47 base::SplitString(version, '.', &version_parts); | |
bengr
2014/07/31 18:22:40
You should check that the vector size is 4.
Option
megjablon
2014/07/31 20:48:36
Done.
| |
48 return version_parts[2] + "." + version_parts[3]; | |
49 } | |
OLD | NEW |