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_settings_factory_and
roid.h" | 5 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_settings_factory_and
roid.h" |
6 #include "base/memory/singleton.h" | 6 #include "base/memory/singleton.h" |
7 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.h" | 7 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" | 9 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" |
10 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 10 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 KeyedService* DataReductionProxySettingsFactoryAndroid::BuildServiceInstanceFor( | 46 KeyedService* DataReductionProxySettingsFactoryAndroid::BuildServiceInstanceFor( |
47 content::BrowserContext* context) const { | 47 content::BrowserContext* context) const { |
48 Profile* profile = static_cast<Profile*>(context); | 48 Profile* profile = static_cast<Profile*>(context); |
49 int flags = DataReductionProxyParams::kFallbackAllowed; | 49 int flags = DataReductionProxyParams::kFallbackAllowed; |
50 if (DataReductionProxyParams::IsIncludedInFieldTrial()) | 50 if (DataReductionProxyParams::IsIncludedInFieldTrial()) |
51 flags |= DataReductionProxyParams::kAllowed; | 51 flags |= DataReductionProxyParams::kAllowed; |
52 if (DataReductionProxyParams::IsIncludedInAlternativeFieldTrial()) | 52 if (DataReductionProxyParams::IsIncludedInAlternativeFieldTrial()) |
53 flags |= DataReductionProxyParams::kAlternativeAllowed; | 53 flags |= DataReductionProxyParams::kAlternativeAllowed; |
54 if (DataReductionProxyParams::IsIncludedInPromoFieldTrial()) | 54 if (DataReductionProxyParams::IsIncludedInPromoFieldTrial()) |
55 flags |= DataReductionProxyParams::kPromoAllowed; | 55 flags |= DataReductionProxyParams::kPromoAllowed; |
| 56 if (DataReductionProxyParams::IsIncludedInHoldbackFieldTrial()) |
| 57 flags |= DataReductionProxyParams::kHoldback; |
56 | 58 |
57 DataReductionProxySettingsAndroid* settings = | 59 DataReductionProxySettingsAndroid* settings = |
58 new DataReductionProxySettingsAndroid( | 60 new DataReductionProxySettingsAndroid( |
59 new DataReductionProxyParams(flags)); | 61 new DataReductionProxyParams(flags)); |
60 settings->InitDataReductionProxySettings(profile); | 62 settings->InitDataReductionProxySettings(profile); |
61 return settings; | 63 return settings; |
62 } | 64 } |
63 | 65 |
OLD | NEW |