| 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 <memory> | 7 #include <memory> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 base::android::JavaLongArrayToInt64Vector(env, offline_ids_array, | 388 base::android::JavaLongArrayToInt64Vector(env, offline_ids_array, |
| 389 &offline_ids); | 389 &offline_ids); |
| 390 | 390 |
| 391 offline_page_model_->DeletePagesByOfflineId( | 391 offline_page_model_->DeletePagesByOfflineId( |
| 392 offline_ids, base::Bind(&DeletePageCallback, j_callback_ref)); | 392 offline_ids, base::Bind(&DeletePageCallback, j_callback_ref)); |
| 393 } | 393 } |
| 394 | 394 |
| 395 void OfflinePageBridge::CheckMetadataConsistency( | 395 void OfflinePageBridge::CheckMetadataConsistency( |
| 396 JNIEnv* env, | 396 JNIEnv* env, |
| 397 const JavaParamRef<jobject>& obj) { | 397 const JavaParamRef<jobject>& obj) { |
| 398 offline_page_model_->CheckForExternalFileDeletion(); | 398 offline_page_model_->CheckMetadataConsistency(); |
| 399 } | 399 } |
| 400 | 400 |
| 401 void OfflinePageBridge::NotifyIfDoneLoading() const { | 401 void OfflinePageBridge::NotifyIfDoneLoading() const { |
| 402 if (!offline_page_model_->is_loaded()) | 402 if (!offline_page_model_->is_loaded()) |
| 403 return; | 403 return; |
| 404 JNIEnv* env = base::android::AttachCurrentThread(); | 404 JNIEnv* env = base::android::AttachCurrentThread(); |
| 405 Java_OfflinePageBridge_offlinePageModelLoaded(env, java_ref_.obj()); | 405 Java_OfflinePageBridge_offlinePageModelLoaded(env, java_ref_.obj()); |
| 406 } | 406 } |
| 407 | 407 |
| 408 | 408 |
| 409 ScopedJavaLocalRef<jobject> OfflinePageBridge::CreateClientId( | 409 ScopedJavaLocalRef<jobject> OfflinePageBridge::CreateClientId( |
| 410 JNIEnv* env, | 410 JNIEnv* env, |
| 411 const ClientId& client_id) const { | 411 const ClientId& client_id) const { |
| 412 return Java_OfflinePageBridge_createClientId( | 412 return Java_OfflinePageBridge_createClientId( |
| 413 env, | 413 env, |
| 414 ConvertUTF8ToJavaString(env, client_id.name_space).obj(), | 414 ConvertUTF8ToJavaString(env, client_id.name_space).obj(), |
| 415 ConvertUTF8ToJavaString(env, client_id.id).obj()); | 415 ConvertUTF8ToJavaString(env, client_id.id).obj()); |
| 416 } | 416 } |
| 417 | 417 |
| 418 bool RegisterOfflinePageBridge(JNIEnv* env) { | 418 bool RegisterOfflinePageBridge(JNIEnv* env) { |
| 419 return RegisterNativesImpl(env); | 419 return RegisterNativesImpl(env); |
| 420 } | 420 } |
| 421 | 421 |
| 422 } // namespace android | 422 } // namespace android |
| 423 } // namespace offline_pages | 423 } // namespace offline_pages |
| OLD | NEW |