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

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

Issue 2103223002: Adding version info to the client config request (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_io_data.h" 5 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_io_data.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
11 #include "build/build_config.h" 11 #include "build/build_config.h"
12 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" 12 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h"
13 #include "chrome/common/channel_info.h"
13 #include "chrome/common/chrome_content_client.h" 14 #include "chrome/common/chrome_content_client.h"
14 #include "chrome/common/pref_names.h" 15 #include "chrome/common/pref_names.h"
15 #include "components/data_reduction_proxy/content/browser/content_lofi_decider.h " 16 #include "components/data_reduction_proxy/content/browser/content_lofi_decider.h "
16 #include "components/data_reduction_proxy/content/browser/content_lofi_ui_servic e.h" 17 #include "components/data_reduction_proxy/content/browser/content_lofi_ui_servic e.h"
17 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h" 18 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h"
18 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h" 19 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h"
19 #include "components/prefs/pref_service.h" 20 #include "components/prefs/pref_service.h"
21 #include "components/version_info/version_info.h"
20 #include "content/public/browser/browser_thread.h" 22 #include "content/public/browser/browser_thread.h"
21 #include "content/public/browser/web_contents.h" 23 #include "content/public/browser/web_contents.h"
22 24
23 #if defined(OS_ANDROID) 25 #if defined(OS_ANDROID)
24 #include "base/android/build_info.h" 26 #include "base/android/build_info.h"
25 #include "chrome/browser/android/tab_android.h" 27 #include "chrome/browser/android/tab_android.h"
26 #endif 28 #endif
27 29
28 namespace content { 30 namespace content {
29 class BrowserContext; 31 class BrowserContext;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 73 }
72 #endif 74 #endif
73 75
74 bool enabled = 76 bool enabled =
75 prefs->GetBoolean(prefs::kDataSaverEnabled) || 77 prefs->GetBoolean(prefs::kDataSaverEnabled) ||
76 data_reduction_proxy::params::ShouldForceEnableDataReductionProxy(); 78 data_reduction_proxy::params::ShouldForceEnableDataReductionProxy();
77 std::unique_ptr<data_reduction_proxy::DataReductionProxyIOData> 79 std::unique_ptr<data_reduction_proxy::DataReductionProxyIOData>
78 data_reduction_proxy_io_data( 80 data_reduction_proxy_io_data(
79 new data_reduction_proxy::DataReductionProxyIOData( 81 new data_reduction_proxy::DataReductionProxyIOData(
80 DataReductionProxyChromeSettings::GetClient(), flags, net_log, 82 DataReductionProxyChromeSettings::GetClient(), flags, net_log,
81 io_task_runner, ui_task_runner, enabled, GetUserAgent())); 83 io_task_runner, ui_task_runner, enabled, GetUserAgent(),
84 version_info::GetChannelString(chrome::GetChannel())));
82 85
83 data_reduction_proxy_io_data->set_lofi_decider( 86 data_reduction_proxy_io_data->set_lofi_decider(
84 base::WrapUnique(new data_reduction_proxy::ContentLoFiDecider())); 87 base::WrapUnique(new data_reduction_proxy::ContentLoFiDecider()));
85 data_reduction_proxy_io_data->set_lofi_ui_service( 88 data_reduction_proxy_io_data->set_lofi_ui_service(
86 base::WrapUnique(new data_reduction_proxy::ContentLoFiUIService( 89 base::WrapUnique(new data_reduction_proxy::ContentLoFiUIService(
87 ui_task_runner, base::Bind(&OnLoFiResponseReceivedOnUI)))); 90 ui_task_runner, base::Bind(&OnLoFiResponseReceivedOnUI))));
88 91
89 return data_reduction_proxy_io_data; 92 return data_reduction_proxy_io_data;
90 } 93 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698