OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_android.h" | 5 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.h" |
6 | 6 |
7 #include "base/android/build_info.h" | 7 #include "base/android/build_info.h" |
8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 bool alternative_enabled, | 188 bool alternative_enabled, |
189 bool restricted, | 189 bool restricted, |
190 bool at_startup) { | 190 bool at_startup) { |
191 // Sanity check: If there's no fallback proxy, we can't do a restricted mode. | 191 // Sanity check: If there's no fallback proxy, we can't do a restricted mode. |
192 std::string fallback = params()->fallback_origin().spec(); | 192 std::string fallback = params()->fallback_origin().spec(); |
193 if (fallback.empty() && enabled && restricted) | 193 if (fallback.empty() && enabled && restricted) |
194 enabled = false; | 194 enabled = false; |
195 | 195 |
196 LogProxyState(enabled, restricted, at_startup); | 196 LogProxyState(enabled, restricted, at_startup); |
197 | 197 |
198 if (enabled) { | 198 if (enabled && !params()->holdback()) { |
199 if (alternative_enabled) { | 199 if (alternative_enabled) { |
200 configurator()->Enable(restricted, | 200 configurator()->Enable(restricted, |
201 !params()->fallback_allowed(), | 201 !params()->fallback_allowed(), |
202 params()->alt_origin().spec(), | 202 params()->alt_origin().spec(), |
203 params()->alt_fallback_origin().spec(), | 203 params()->alt_fallback_origin().spec(), |
204 params()->ssl_origin().spec()); | 204 params()->ssl_origin().spec()); |
205 } else { | 205 } else { |
206 configurator()->Enable(restricted, | 206 configurator()->Enable(restricted, |
207 !params()->fallback_allowed(), | 207 !params()->fallback_allowed(), |
208 params()->origin().spec(), | 208 params()->origin().spec(), |
(...skipping 25 matching lines...) Expand all Loading... |
234 | 234 |
235 | 235 |
236 | 236 |
237 // Used by generated jni code. | 237 // Used by generated jni code. |
238 static jlong Init(JNIEnv* env, jobject obj) { | 238 static jlong Init(JNIEnv* env, jobject obj) { |
239 DataReductionProxySettingsAndroid* settings = | 239 DataReductionProxySettingsAndroid* settings = |
240 DataReductionProxySettingsFactoryAndroid::GetForBrowserContext( | 240 DataReductionProxySettingsFactoryAndroid::GetForBrowserContext( |
241 ProfileManager::GetActiveUserProfile()); | 241 ProfileManager::GetActiveUserProfile()); |
242 return reinterpret_cast<intptr_t>(settings); | 242 return reinterpret_cast<intptr_t>(settings); |
243 } | 243 } |
OLD | NEW |