| 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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 if (web_contents) { | 442 if (web_contents) { |
| 443 save_page_params.url = web_contents->GetLastCommittedURL(); | 443 save_page_params.url = web_contents->GetLastCommittedURL(); |
| 444 archiver.reset(new OfflinePageMHTMLArchiver(web_contents)); | 444 archiver.reset(new OfflinePageMHTMLArchiver(web_contents)); |
| 445 } | 445 } |
| 446 | 446 |
| 447 save_page_params.client_id.name_space = | 447 save_page_params.client_id.name_space = |
| 448 ConvertJavaStringToUTF8(env, j_namespace); | 448 ConvertJavaStringToUTF8(env, j_namespace); |
| 449 save_page_params.client_id.id = ConvertJavaStringToUTF8(env, j_client_id); | 449 save_page_params.client_id.id = ConvertJavaStringToUTF8(env, j_client_id); |
| 450 save_page_params.is_background = false; | 450 save_page_params.is_background = false; |
| 451 | 451 |
| 452 std::string signal_data; |
| 453 |
| 452 offline_page_model_->SavePage( | 454 offline_page_model_->SavePage( |
| 453 save_page_params, std::move(archiver), | 455 save_page_params, std::move(archiver), signal_data, |
| 454 base::Bind(&SavePageCallback, j_callback_ref, save_page_params.url)); | 456 base::Bind(&SavePageCallback, j_callback_ref, save_page_params.url)); |
| 455 } | 457 } |
| 456 | 458 |
| 457 void OfflinePageBridge::SavePageLater(JNIEnv* env, | 459 void OfflinePageBridge::SavePageLater(JNIEnv* env, |
| 458 const JavaParamRef<jobject>& obj, | 460 const JavaParamRef<jobject>& obj, |
| 459 const JavaParamRef<jstring>& j_url, | 461 const JavaParamRef<jstring>& j_url, |
| 460 const JavaParamRef<jstring>& j_namespace, | 462 const JavaParamRef<jstring>& j_namespace, |
| 461 const JavaParamRef<jstring>& j_client_id, | 463 const JavaParamRef<jstring>& j_client_id, |
| 462 jboolean user_requested) { | 464 jboolean user_requested) { |
| 463 offline_pages::ClientId client_id; | 465 offline_pages::ClientId client_id; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 env, ConvertUTF8ToJavaString(env, client_id.name_space), | 633 env, ConvertUTF8ToJavaString(env, client_id.name_space), |
| 632 ConvertUTF8ToJavaString(env, client_id.id)); | 634 ConvertUTF8ToJavaString(env, client_id.id)); |
| 633 } | 635 } |
| 634 | 636 |
| 635 bool RegisterOfflinePageBridge(JNIEnv* env) { | 637 bool RegisterOfflinePageBridge(JNIEnv* env) { |
| 636 return RegisterNativesImpl(env); | 638 return RegisterNativesImpl(env); |
| 637 } | 639 } |
| 638 | 640 |
| 639 } // namespace android | 641 } // namespace android |
| 640 } // namespace offline_pages | 642 } // namespace offline_pages |
| OLD | NEW |