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

Side by Side Diff: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.cc

Issue 430643002: Correcting the version field in the Chrome-Proxy header to be the chromium build and patch number. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing Lei comments Created 6 years, 4 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 unified diff | Download patch
OLDNEW
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"
8 #include "base/strings/string_util.h"
Lei Zhang 2014/08/01 20:43:15 no longer needed.
megjablon 2014/08/01 21:00:30 Done.
7 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator. h" 10 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator. h"
9 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/profiles/profile_manager.h" 12 #include "chrome/browser/profiles/profile_manager.h"
13 #include "chrome/common/chrome_version_info.h"
14 #include "components/data_reduction_proxy/browser/data_reduction_proxy_auth_requ est_handler.h"
11 #include "components/data_reduction_proxy/browser/data_reduction_proxy_configura tor.h" 15 #include "components/data_reduction_proxy/browser/data_reduction_proxy_configura tor.h"
12 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" 16 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h"
13 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h" 17 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h"
14 18
15 using data_reduction_proxy::DataReductionProxyParams; 19 using data_reduction_proxy::DataReductionProxyParams;
16 using data_reduction_proxy::DataReductionProxySettings; 20 using data_reduction_proxy::DataReductionProxySettings;
17 21
18 DataReductionProxyChromeSettings::DataReductionProxyChromeSettings( 22 DataReductionProxyChromeSettings::DataReductionProxyChromeSettings(
19 DataReductionProxyParams* params) : DataReductionProxySettings(params) { 23 DataReductionProxyParams* params) : DataReductionProxySettings(params) {
20 } 24 }
(...skipping 10 matching lines...) Expand all
31 configurator(new DataReductionProxyChromeConfigurator(prefs)); 35 configurator(new DataReductionProxyChromeConfigurator(prefs));
32 SetProxyConfigurator(configurator.Pass()); 36 SetProxyConfigurator(configurator.Pass());
33 DataReductionProxySettings::InitDataReductionProxySettings( 37 DataReductionProxySettings::InitDataReductionProxySettings(
34 prefs, 38 prefs,
35 g_browser_process->local_state(), 39 g_browser_process->local_state(),
36 ProfileManager::GetActiveUserProfile()->GetRequestContext()); 40 ProfileManager::GetActiveUserProfile()->GetRequestContext());
37 41
38 SetDataReductionProxyAlternativeEnabled( 42 SetDataReductionProxyAlternativeEnabled(
39 DataReductionProxyParams::IsIncludedInAlternativeFieldTrial()); 43 DataReductionProxyParams::IsIncludedInAlternativeFieldTrial());
40 } 44 }
45
46 // static
47 std::string DataReductionProxyChromeSettings::GetBuildAndPatchNumber() {
48 chrome::VersionInfo version_info;
49 std::vector<std::string> version_parts;
50 base::SplitString(version_info.Version(), '.', &version_parts);
51 if (version_parts.size() != 4)
52 return "";
53 return version_parts[2] + version_parts[3];
54 }
55
56 // static
57 std::string DataReductionProxyChromeSettings::GetClient() {
58 #if defined(OS_ANDROID)
59 return data_reduction_proxy::kClientChromeAndroid;
60 #elif defined(OS_IOS)
61 return data_reduction_proxy::kClientChromeIOS;
62 #else
63 return "";
64 #endif
65 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698