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

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 bengr 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"
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"
11 #include "components/data_reduction_proxy/browser/data_reduction_proxy_configura tor.h" 13 #include "components/data_reduction_proxy/browser/data_reduction_proxy_configura tor.h"
12 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" 14 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h"
13 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h" 15 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h"
14 16
15 using data_reduction_proxy::DataReductionProxyParams; 17 using data_reduction_proxy::DataReductionProxyParams;
16 using data_reduction_proxy::DataReductionProxySettings; 18 using data_reduction_proxy::DataReductionProxySettings;
(...skipping 14 matching lines...) Expand all
31 configurator(new DataReductionProxyChromeConfigurator(prefs)); 33 configurator(new DataReductionProxyChromeConfigurator(prefs));
32 SetProxyConfigurator(configurator.Pass()); 34 SetProxyConfigurator(configurator.Pass());
33 DataReductionProxySettings::InitDataReductionProxySettings( 35 DataReductionProxySettings::InitDataReductionProxySettings(
34 prefs, 36 prefs,
35 g_browser_process->local_state(), 37 g_browser_process->local_state(),
36 ProfileManager::GetActiveUserProfile()->GetRequestContext()); 38 ProfileManager::GetActiveUserProfile()->GetRequestContext());
37 39
38 SetDataReductionProxyAlternativeEnabled( 40 SetDataReductionProxyAlternativeEnabled(
39 DataReductionProxyParams::IsIncludedInAlternativeFieldTrial()); 41 DataReductionProxyParams::IsIncludedInAlternativeFieldTrial());
40 } 42 }
43
44 // static
45 std::string DataReductionProxyChromeSettings::GetBuildAndPatchNumber() {
46 chrome::VersionInfo version_info;
47 std::vector<std::string> version_parts;
48 base::SplitString(version_info.Version(), '.', &version_parts);
49 if (version_parts.size() != 4) {
50 return "";
51 }
Lei Zhang 2014/08/01 19:11:57 nit: you don't need the braces.
megjablon 2014/08/01 20:35:26 Done.
52 version_parts.erase(version_parts.begin(), version_parts.begin() + 2);
Lei Zhang 2014/08/01 19:11:57 nit: isn't the rest of the function just: return v
megjablon 2014/08/01 20:35:26 Ya I had this originally and like it better. Switc
53 return JoinString(version_parts, '.');
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