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

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

Issue 1688603004: AGSA-initiated weblite intents should be rewritten if Chrome can use weblite (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bug fix Created 4 years, 9 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 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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
11 #include "base/values.h" 11 #include "base/values.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/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact ory.h" 13 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_fact ory.h"
14 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
15 #include "chrome/browser/profiles/profile_manager.h" 15 #include "chrome/browser/profiles/profile_manager.h"
16 #include "chrome/common/pref_names.h" 16 #include "chrome/common/pref_names.h"
17 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_metr ics.h" 17 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_metr ics.h"
18 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h" 18 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h"
19 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_event _store.h" 19 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_event _store.h"
20 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h"
20 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_ names.h" 21 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_ names.h"
21 #include "jni/DataReductionProxySettings_jni.h" 22 #include "jni/DataReductionProxySettings_jni.h"
22 #include "net/proxy/proxy_server.h" 23 #include "net/proxy/proxy_server.h"
23 #include "url/gurl.h" 24 #include "url/gurl.h"
24 25
25 26
26 using base::android::ConvertUTF8ToJavaString; 27 using base::android::ConvertUTF8ToJavaString;
27 using base::android::ScopedJavaLocalRef; 28 using base::android::ScopedJavaLocalRef;
28 using data_reduction_proxy::DataReductionProxySettings; 29 using data_reduction_proxy::DataReductionProxySettings;
29 30
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 return GetDailyContentLengths( 148 return GetDailyContentLengths(
148 env, data_reduction_proxy::prefs::kDailyHttpReceivedContentLength); 149 env, data_reduction_proxy::prefs::kDailyHttpReceivedContentLength);
149 } 150 }
150 151
151 jboolean DataReductionProxySettingsAndroid::IsDataReductionProxyUnreachable( 152 jboolean DataReductionProxySettingsAndroid::IsDataReductionProxyUnreachable(
152 JNIEnv* env, 153 JNIEnv* env,
153 const JavaParamRef<jobject>& obj) { 154 const JavaParamRef<jobject>& obj) {
154 return Settings()->IsDataReductionProxyUnreachable(); 155 return Settings()->IsDataReductionProxyUnreachable();
155 } 156 }
156 157
158 jboolean DataReductionProxySettingsAndroid::AreLoFiPreviewsEnabled(
159 JNIEnv* env,
160 const JavaParamRef<jobject>& obj) {
161 return data_reduction_proxy::params::IsIncludedInLoFiPreviewFieldTrial() ||
162 (data_reduction_proxy::params::IsLoFiOnViaFlags() &&
163 data_reduction_proxy::params::AreLoFiPreviewsEnabledViaFlags());
164 }
165
157 // static 166 // static
158 bool DataReductionProxySettingsAndroid::Register(JNIEnv* env) { 167 bool DataReductionProxySettingsAndroid::Register(JNIEnv* env) {
159 return RegisterNativesImpl(env); 168 return RegisterNativesImpl(env);
160 } 169 }
161 170
162 ScopedJavaLocalRef<jlongArray> 171 ScopedJavaLocalRef<jlongArray>
163 DataReductionProxySettingsAndroid::GetDailyContentLengths( 172 DataReductionProxySettingsAndroid::GetDailyContentLengths(
164 JNIEnv* env, const char* pref_name) { 173 JNIEnv* env, const char* pref_name) {
165 jlongArray result = env->NewLongArray( 174 jlongArray result = env->NewLongArray(
166 data_reduction_proxy::kNumDaysInHistory); 175 data_reduction_proxy::kNumDaysInHistory);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 if (!event_store) 226 if (!event_store)
218 return ConvertUTF8ToJavaString(env, std::string()); 227 return ConvertUTF8ToJavaString(env, std::string());
219 228
220 return ConvertUTF8ToJavaString(env, event_store->SanitizedLastBypassEvent()); 229 return ConvertUTF8ToJavaString(env, event_store->SanitizedLastBypassEvent());
221 } 230 }
222 231
223 // Used by generated jni code. 232 // Used by generated jni code.
224 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { 233 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) {
225 return reinterpret_cast<intptr_t>(new DataReductionProxySettingsAndroid()); 234 return reinterpret_cast<intptr_t>(new DataReductionProxySettingsAndroid());
226 } 235 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698