Chromium Code Reviews| 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/android/offline_pages/offline_page_bridge.h" | 5 #include "chrome/browser/android/offline_pages/offline_page_bridge.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/android/jni_array.h" | 9 #include "base/android/jni_array.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 offline_page.access_count, offline_page.last_access_time.ToJavaTime()); | 69 offline_page.access_count, offline_page.last_access_time.ToJavaTime()); |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 | 72 |
| 73 } // namespace | 73 } // namespace |
| 74 | 74 |
| 75 static jint GetFeatureMode(JNIEnv* env, const JavaParamRef<jclass>& clazz) { | 75 static jint GetFeatureMode(JNIEnv* env, const JavaParamRef<jclass>& clazz) { |
| 76 return static_cast<jint>(offline_pages::GetOfflinePageFeatureMode()); | 76 return static_cast<jint>(offline_pages::GetOfflinePageFeatureMode()); |
| 77 } | 77 } |
| 78 | 78 |
| 79 static jboolean IsOfflinePagesBackgroundLoadingEnabled( | |
| 80 JNIEnv* env, const JavaParamRef<jclass>& clazz) { | |
|
Alexei Svitkine (slow)
2016/03/14 15:42:48
Nit: 1 param per line when the first one wraps.
Pete Williamson
2016/03/14 17:36:51
Done.
| |
| 81 return offline_pages::IsOfflinePagesBackgroundLoadingEnabled(); | |
| 82 } | |
| 83 | |
| 79 static jboolean CanSavePage(JNIEnv* env, | 84 static jboolean CanSavePage(JNIEnv* env, |
| 80 const JavaParamRef<jclass>& clazz, | 85 const JavaParamRef<jclass>& clazz, |
| 81 const JavaParamRef<jstring>& j_url) { | 86 const JavaParamRef<jstring>& j_url) { |
| 82 GURL url(ConvertJavaStringToUTF8(env, j_url)); | 87 GURL url(ConvertJavaStringToUTF8(env, j_url)); |
| 83 return url.is_valid() && OfflinePageModel::CanSavePage(url); | 88 return url.is_valid() && OfflinePageModel::CanSavePage(url); |
| 84 } | 89 } |
| 85 | 90 |
| 86 static ScopedJavaLocalRef<jobject> GetOfflinePageBridgeForProfile( | 91 static ScopedJavaLocalRef<jobject> GetOfflinePageBridgeForProfile( |
| 87 JNIEnv* env, | 92 JNIEnv* env, |
| 88 const JavaParamRef<jclass>& jcaller, | 93 const JavaParamRef<jclass>& jcaller, |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 310 offline_page.file_size, offline_page.creation_time.ToJavaTime(), | 315 offline_page.file_size, offline_page.creation_time.ToJavaTime(), |
| 311 offline_page.access_count, offline_page.last_access_time.ToJavaTime()); | 316 offline_page.access_count, offline_page.last_access_time.ToJavaTime()); |
| 312 } | 317 } |
| 313 | 318 |
| 314 bool RegisterOfflinePageBridge(JNIEnv* env) { | 319 bool RegisterOfflinePageBridge(JNIEnv* env) { |
| 315 return RegisterNativesImpl(env); | 320 return RegisterNativesImpl(env); |
| 316 } | 321 } |
| 317 | 322 |
| 318 } // namespace android | 323 } // namespace android |
| 319 } // namespace offline_pages | 324 } // namespace offline_pages |
| OLD | NEW |