| 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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 const JavaParamRef<jstring>& j_client_id, | 422 const JavaParamRef<jstring>& j_client_id, |
| 423 jboolean user_requested) { | 423 jboolean user_requested) { |
| 424 offline_pages::ClientId client_id; | 424 offline_pages::ClientId client_id; |
| 425 client_id.name_space = ConvertJavaStringToUTF8(env, j_namespace); | 425 client_id.name_space = ConvertJavaStringToUTF8(env, j_namespace); |
| 426 client_id.id = ConvertJavaStringToUTF8(env, j_client_id); | 426 client_id.id = ConvertJavaStringToUTF8(env, j_client_id); |
| 427 | 427 |
| 428 RequestCoordinator* coordinator = | 428 RequestCoordinator* coordinator = |
| 429 offline_pages::RequestCoordinatorFactory::GetInstance()-> | 429 offline_pages::RequestCoordinatorFactory::GetInstance()-> |
| 430 GetForBrowserContext(browser_context_); | 430 GetForBrowserContext(browser_context_); |
| 431 | 431 |
| 432 coordinator->SavePageLater(GURL(ConvertJavaStringToUTF8(env, j_url)), | 432 coordinator->SavePageLater( |
| 433 client_id, static_cast<bool>(user_requested)); | 433 GURL(ConvertJavaStringToUTF8(env, j_url)), client_id, |
| 434 static_cast<bool>(user_requested), |
| 435 RequestCoordinator::RequestAvailability::ENABLED_FOR_OFFLINER); |
| 434 } | 436 } |
| 435 | 437 |
| 436 void OfflinePageBridge::DeletePages( | 438 void OfflinePageBridge::DeletePages( |
| 437 JNIEnv* env, | 439 JNIEnv* env, |
| 438 const JavaParamRef<jobject>& obj, | 440 const JavaParamRef<jobject>& obj, |
| 439 const JavaParamRef<jobject>& j_callback_obj, | 441 const JavaParamRef<jobject>& j_callback_obj, |
| 440 const JavaParamRef<jlongArray>& offline_ids_array) { | 442 const JavaParamRef<jlongArray>& offline_ids_array) { |
| 441 DCHECK(j_callback_obj); | 443 DCHECK(j_callback_obj); |
| 442 | 444 |
| 443 ScopedJavaGlobalRef<jobject> j_callback_ref; | 445 ScopedJavaGlobalRef<jobject> j_callback_ref; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 env, ConvertUTF8ToJavaString(env, client_id.name_space), | 542 env, ConvertUTF8ToJavaString(env, client_id.name_space), |
| 541 ConvertUTF8ToJavaString(env, client_id.id)); | 543 ConvertUTF8ToJavaString(env, client_id.id)); |
| 542 } | 544 } |
| 543 | 545 |
| 544 bool RegisterOfflinePageBridge(JNIEnv* env) { | 546 bool RegisterOfflinePageBridge(JNIEnv* env) { |
| 545 return RegisterNativesImpl(env); | 547 return RegisterNativesImpl(env); |
| 546 } | 548 } |
| 547 | 549 |
| 548 } // namespace android | 550 } // namespace android |
| 549 } // namespace offline_pages | 551 } // namespace offline_pages |
| OLD | NEW |