| 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 content::WebContents* web_contents = | 438 content::WebContents* web_contents = |
| 439 content::WebContents::FromJavaWebContents(j_web_contents); | 439 content::WebContents::FromJavaWebContents(j_web_contents); |
| 440 if (web_contents) { | 440 if (web_contents) { |
| 441 save_page_params.url = web_contents->GetLastCommittedURL(); | 441 save_page_params.url = web_contents->GetLastCommittedURL(); |
| 442 archiver.reset(new OfflinePageMHTMLArchiver(web_contents)); | 442 archiver.reset(new OfflinePageMHTMLArchiver(web_contents)); |
| 443 } | 443 } |
| 444 | 444 |
| 445 save_page_params.client_id.name_space = | 445 save_page_params.client_id.name_space = |
| 446 ConvertJavaStringToUTF8(env, j_namespace); | 446 ConvertJavaStringToUTF8(env, j_namespace); |
| 447 save_page_params.client_id.id = ConvertJavaStringToUTF8(env, j_client_id); | 447 save_page_params.client_id.id = ConvertJavaStringToUTF8(env, j_client_id); |
| 448 save_page_params.is_background = false; |
| 448 | 449 |
| 449 offline_page_model_->SavePage( | 450 offline_page_model_->SavePage( |
| 450 save_page_params, std::move(archiver), | 451 save_page_params, std::move(archiver), |
| 451 base::Bind(&SavePageCallback, j_callback_ref, save_page_params.url)); | 452 base::Bind(&SavePageCallback, j_callback_ref, save_page_params.url)); |
| 452 } | 453 } |
| 453 | 454 |
| 454 void OfflinePageBridge::SavePageLater(JNIEnv* env, | 455 void OfflinePageBridge::SavePageLater(JNIEnv* env, |
| 455 const JavaParamRef<jobject>& obj, | 456 const JavaParamRef<jobject>& obj, |
| 456 const JavaParamRef<jstring>& j_url, | 457 const JavaParamRef<jstring>& j_url, |
| 457 const JavaParamRef<jstring>& j_namespace, | 458 const JavaParamRef<jstring>& j_namespace, |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 env, ConvertUTF8ToJavaString(env, client_id.name_space), | 584 env, ConvertUTF8ToJavaString(env, client_id.name_space), |
| 584 ConvertUTF8ToJavaString(env, client_id.id)); | 585 ConvertUTF8ToJavaString(env, client_id.id)); |
| 585 } | 586 } |
| 586 | 587 |
| 587 bool RegisterOfflinePageBridge(JNIEnv* env) { | 588 bool RegisterOfflinePageBridge(JNIEnv* env) { |
| 588 return RegisterNativesImpl(env); | 589 return RegisterNativesImpl(env); |
| 589 } | 590 } |
| 590 | 591 |
| 591 } // namespace android | 592 } // namespace android |
| 592 } // namespace offline_pages | 593 } // namespace offline_pages |
| OLD | NEW |