| 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 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 j_callback_ref.Reset(env, j_callback_obj); | 444 j_callback_ref.Reset(env, j_callback_obj); |
| 445 | 445 |
| 446 std::vector<int64_t> offline_ids; | 446 std::vector<int64_t> offline_ids; |
| 447 base::android::JavaLongArrayToInt64Vector(env, offline_ids_array, | 447 base::android::JavaLongArrayToInt64Vector(env, offline_ids_array, |
| 448 &offline_ids); | 448 &offline_ids); |
| 449 | 449 |
| 450 offline_page_model_->DeletePagesByOfflineId( | 450 offline_page_model_->DeletePagesByOfflineId( |
| 451 offline_ids, base::Bind(&DeletePageCallback, j_callback_ref)); | 451 offline_ids, base::Bind(&DeletePageCallback, j_callback_ref)); |
| 452 } | 452 } |
| 453 | 453 |
| 454 void OfflinePageBridge::CheckMetadataConsistency( | |
| 455 JNIEnv* env, | |
| 456 const JavaParamRef<jobject>& obj) { | |
| 457 offline_page_model_->CheckMetadataConsistency(); | |
| 458 } | |
| 459 | |
| 460 ScopedJavaLocalRef<jstring> OfflinePageBridge::GetOfflinePageHeaderForReload( | 454 ScopedJavaLocalRef<jstring> OfflinePageBridge::GetOfflinePageHeaderForReload( |
| 461 JNIEnv* env, | 455 JNIEnv* env, |
| 462 const base::android::JavaParamRef<jobject>& obj, | 456 const base::android::JavaParamRef<jobject>& obj, |
| 463 const JavaParamRef<jobject>& j_web_contents) { | 457 const JavaParamRef<jobject>& j_web_contents) { |
| 464 content::WebContents* web_contents = | 458 content::WebContents* web_contents = |
| 465 content::WebContents::FromJavaWebContents(j_web_contents); | 459 content::WebContents::FromJavaWebContents(j_web_contents); |
| 466 if (!web_contents) | 460 if (!web_contents) |
| 467 return ScopedJavaLocalRef<jstring>(); | 461 return ScopedJavaLocalRef<jstring>(); |
| 468 | 462 |
| 469 const offline_pages::OfflinePageHeader* offline_header = | 463 const offline_pages::OfflinePageHeader* offline_header = |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 env, ConvertUTF8ToJavaString(env, client_id.name_space), | 540 env, ConvertUTF8ToJavaString(env, client_id.name_space), |
| 547 ConvertUTF8ToJavaString(env, client_id.id)); | 541 ConvertUTF8ToJavaString(env, client_id.id)); |
| 548 } | 542 } |
| 549 | 543 |
| 550 bool RegisterOfflinePageBridge(JNIEnv* env) { | 544 bool RegisterOfflinePageBridge(JNIEnv* env) { |
| 551 return RegisterNativesImpl(env); | 545 return RegisterNativesImpl(env); |
| 552 } | 546 } |
| 553 | 547 |
| 554 } // namespace android | 548 } // namespace android |
| 555 } // namespace offline_pages | 549 } // namespace offline_pages |
| OLD | NEW |