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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 NUM_SPDY_PROXY_AUTH_STATE | 55 NUM_SPDY_PROXY_AUTH_STATE |
56 }; | 56 }; |
57 | 57 |
58 const char kEnabled[] = "Enabled"; | 58 const char kEnabled[] = "Enabled"; |
59 | 59 |
60 } // namespace | 60 } // namespace |
61 | 61 |
62 DataReductionProxySettingsAndroid::DataReductionProxySettingsAndroid( | 62 DataReductionProxySettingsAndroid::DataReductionProxySettingsAndroid( |
63 JNIEnv* env, jobject obj) : DataReductionProxySettings() { | 63 JNIEnv* env, jobject obj) : DataReductionProxySettings() { |
64 #if defined(SPDY_PROXY_AUTH_VALUE) | 64 #if defined(SPDY_PROXY_AUTH_VALUE) |
65 SetKey(SPDY_PROXY_AUTH_VALUE); | 65 set_key(SPDY_PROXY_AUTH_VALUE); |
66 #endif | 66 #endif |
67 SetAllowed(IsIncludedInFieldTrialOrFlags()); | 67 SetAllowed(IsIncludedInFieldTrialOrFlags()); |
68 SetPromoAllowed(base::FieldTrialList::FindFullName( | 68 SetPromoAllowed(base::FieldTrialList::FindFullName( |
69 "DataCompressionProxyPromoVisibility") == kEnabled); | 69 "DataCompressionProxyPromoVisibility") == kEnabled); |
70 } | 70 } |
71 | 71 |
72 DataReductionProxySettingsAndroid::DataReductionProxySettingsAndroid() { | 72 DataReductionProxySettingsAndroid::DataReductionProxySettingsAndroid() { |
73 #if defined(SPDY_PROXY_AUTH_VALUE) | 73 #if defined(SPDY_PROXY_AUTH_VALUE) |
74 SetKey(SPDY_PROXY_AUTH_VALUE); | 74 set_key(SPDY_PROXY_AUTH_VALUE); |
75 #endif | 75 #endif |
76 } | 76 } |
77 | 77 |
78 DataReductionProxySettingsAndroid::~DataReductionProxySettingsAndroid() { | 78 DataReductionProxySettingsAndroid::~DataReductionProxySettingsAndroid() { |
79 } | 79 } |
80 | 80 |
81 void DataReductionProxySettingsAndroid::InitDataReductionProxySettings( | 81 void DataReductionProxySettingsAndroid::InitDataReductionProxySettings( |
82 JNIEnv* env, | 82 JNIEnv* env, |
83 jobject obj) { | 83 jobject obj) { |
84 PrefService* prefs = ProfileManager::GetActiveUserProfile()->GetPrefs(); | 84 PrefService* prefs = ProfileManager::GetActiveUserProfile()->GetPrefs(); |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 } | 252 } |
253 | 253 |
254 | 254 |
255 | 255 |
256 // Used by generated jni code. | 256 // Used by generated jni code. |
257 static jlong Init(JNIEnv* env, jobject obj) { | 257 static jlong Init(JNIEnv* env, jobject obj) { |
258 DataReductionProxySettingsAndroid* settings = | 258 DataReductionProxySettingsAndroid* settings = |
259 new DataReductionProxySettingsAndroid(env, obj); | 259 new DataReductionProxySettingsAndroid(env, obj); |
260 return reinterpret_cast<intptr_t>(settings); | 260 return reinterpret_cast<intptr_t>(settings); |
261 } | 261 } |
OLD | NEW |