OLD | NEW |
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 "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | 8 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
9 #include "chrome/common/chrome_content_client.h" | 9 #include "chrome/common/chrome_content_client.h" |
10 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
ig_retrieval_params.h" | 10 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_conf
ig_retrieval_params.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 DCHECK(prefs); | 40 DCHECK(prefs); |
41 | 41 |
42 int flags = DataReductionProxyParams::kAllowed | | 42 int flags = DataReductionProxyParams::kAllowed | |
43 DataReductionProxyParams::kFallbackAllowed; | 43 DataReductionProxyParams::kFallbackAllowed; |
44 if (data_reduction_proxy::params::IsIncludedInPromoFieldTrial()) | 44 if (data_reduction_proxy::params::IsIncludedInPromoFieldTrial()) |
45 flags |= DataReductionProxyParams::kPromoAllowed; | 45 flags |= DataReductionProxyParams::kPromoAllowed; |
46 if (data_reduction_proxy::params::IsIncludedInHoldbackFieldTrial()) | 46 if (data_reduction_proxy::params::IsIncludedInHoldbackFieldTrial()) |
47 flags |= DataReductionProxyParams::kHoldback; | 47 flags |= DataReductionProxyParams::kHoldback; |
48 #if defined(OS_ANDROID) | 48 #if defined(OS_ANDROID) |
49 if (data_reduction_proxy::params::IsIncludedInAndroidOnePromoFieldTrial( | 49 if (data_reduction_proxy::params::IsIncludedInAndroidOnePromoFieldTrial( |
50 base::android::BuildInfo::GetInstance()->android_build_fp())) { | 50 base::android::BuildInfo::GetInstance()->build_fp())) { |
51 flags |= DataReductionProxyParams::kPromoAllowed; | 51 flags |= DataReductionProxyParams::kPromoAllowed; |
52 } | 52 } |
53 #endif | 53 #endif |
54 | 54 |
55 bool enabled = | 55 bool enabled = |
56 prefs->GetBoolean( | 56 prefs->GetBoolean( |
57 data_reduction_proxy::prefs::kDataReductionProxyEnabled) || | 57 data_reduction_proxy::prefs::kDataReductionProxyEnabled) || |
58 data_reduction_proxy::params::ShouldForceEnableDataReductionProxy(); | 58 data_reduction_proxy::params::ShouldForceEnableDataReductionProxy(); |
59 scoped_ptr<data_reduction_proxy::DataReductionProxyIOData> | 59 scoped_ptr<data_reduction_proxy::DataReductionProxyIOData> |
60 data_reduction_proxy_io_data( | 60 data_reduction_proxy_io_data( |
(...skipping 14 matching lines...) Expand all Loading... |
75 base::Unretained( | 75 base::Unretained( |
76 data_reduction_proxy_io_data->configurator())), | 76 data_reduction_proxy_io_data->configurator())), |
77 ui_task_runner, io_task_runner, | 77 ui_task_runner, io_task_runner, |
78 g_browser_process->GetApplicationLocale())); | 78 g_browser_process->GetApplicationLocale())); |
79 data_reduction_proxy_io_data->set_debug_ui_service( | 79 data_reduction_proxy_io_data->set_debug_ui_service( |
80 data_reduction_proxy_ui_service.Pass()); | 80 data_reduction_proxy_ui_service.Pass()); |
81 #endif | 81 #endif |
82 | 82 |
83 return data_reduction_proxy_io_data.Pass(); | 83 return data_reduction_proxy_io_data.Pass(); |
84 } | 84 } |
OLD | NEW |