| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/downloads/offline_page_download_b
ridge.h" | 5 #include "chrome/browser/android/offline_pages/downloads/offline_page_download_b
ridge.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 base::MakeUnique<offline_pages::OfflinePageMHTMLArchiver>(web_contents); | 245 base::MakeUnique<offline_pages::OfflinePageMHTMLArchiver>(web_contents); |
| 246 | 246 |
| 247 DownloadUIItem item; | 247 DownloadUIItem item; |
| 248 item.guid = client_id.id; | 248 item.guid = client_id.id; |
| 249 item.url = url; | 249 item.url = url; |
| 250 | 250 |
| 251 OfflinePageNotificationBridge bridge; | 251 OfflinePageNotificationBridge bridge; |
| 252 bridge.NotifyDownloadProgress(item); | 252 bridge.NotifyDownloadProgress(item); |
| 253 | 253 |
| 254 offline_page_model->SavePage( | 254 offline_page_model->SavePage( |
| 255 url, client_id, 0ul, std::move(archiver), | 255 url, client_id, 0l, std::move(archiver), |
| 256 base::Bind(&OfflinePageDownloadBridge::SavePageCallback, item)); | 256 base::Bind(&OfflinePageDownloadBridge::SavePageCallback, item)); |
| 257 } | 257 } |
| 258 | 258 |
| 259 void OfflinePageDownloadBridge::CancelDownload( | 259 void OfflinePageDownloadBridge::CancelDownload( |
| 260 JNIEnv* env, | 260 JNIEnv* env, |
| 261 const JavaParamRef<jobject>& obj, | 261 const JavaParamRef<jobject>& obj, |
| 262 const JavaParamRef<jstring>& j_guid) { | 262 const JavaParamRef<jstring>& j_guid) { |
| 263 std::string guid = ConvertJavaStringToUTF8(env, j_guid); | 263 std::string guid = ConvertJavaStringToUTF8(env, j_guid); |
| 264 RequestCoordinator* coordinator = | 264 RequestCoordinator* coordinator = |
| 265 RequestCoordinatorFactory::GetForBrowserContext(browser_context_); | 265 RequestCoordinatorFactory::GetForBrowserContext(browser_context_); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 | 350 |
| 351 DownloadUIAdapter* adapter = | 351 DownloadUIAdapter* adapter = |
| 352 DownloadUIAdapter::FromOfflinePageModel(offline_page_model); | 352 DownloadUIAdapter::FromOfflinePageModel(offline_page_model); |
| 353 | 353 |
| 354 return reinterpret_cast<jlong>( | 354 return reinterpret_cast<jlong>( |
| 355 new OfflinePageDownloadBridge(env, obj, adapter, browser_context)); | 355 new OfflinePageDownloadBridge(env, obj, adapter, browser_context)); |
| 356 } | 356 } |
| 357 | 357 |
| 358 } // namespace android | 358 } // namespace android |
| 359 } // namespace offline_pages | 359 } // namespace offline_pages |
| OLD | NEW |