| 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_notificati
on_bridge.h" | 5 #include "chrome/browser/android/offline_pages/downloads/offline_page_notificati
on_bridge.h" |
| 6 | 6 |
| 7 #include "base/android/context_utils.h" | 7 #include "base/android/context_utils.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "chrome/browser/android/offline_pages/downloads/offline_page_download_b
ridge.h" | 9 #include "chrome/browser/android/offline_pages/downloads/offline_page_download_b
ridge.h" |
| 10 #include "jni/OfflinePageNotificationBridge_jni.h" | 10 #include "jni/OfflinePageNotificationBridge_jni.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 env, GetApplicationContext(), ConvertUTF8ToJavaString(env, item.guid), | 49 env, GetApplicationContext(), ConvertUTF8ToJavaString(env, item.guid), |
| 50 ConvertUTF8ToJavaString(env, item.url.spec()), GetDisplayName(item)); | 50 ConvertUTF8ToJavaString(env, item.url.spec()), GetDisplayName(item)); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void OfflinePageNotificationBridge::NotifyDownloadProgress( | 53 void OfflinePageNotificationBridge::NotifyDownloadProgress( |
| 54 const DownloadUIItem& item) { | 54 const DownloadUIItem& item) { |
| 55 JNIEnv* env = AttachCurrentThread(); | 55 JNIEnv* env = AttachCurrentThread(); |
| 56 Java_OfflinePageNotificationBridge_notifyDownloadProgress( | 56 Java_OfflinePageNotificationBridge_notifyDownloadProgress( |
| 57 env, GetApplicationContext(), ConvertUTF8ToJavaString(env, item.guid), | 57 env, GetApplicationContext(), ConvertUTF8ToJavaString(env, item.guid), |
| 58 ConvertUTF8ToJavaString(env, item.url.spec()), | 58 ConvertUTF8ToJavaString(env, item.url.spec()), |
| 59 item.start_time.ToJavaTime(), GetDisplayName(item)); | 59 item.start_time.ToJavaTime(), item.download_progress_bytes, |
| 60 GetDisplayName(item)); |
| 60 } | 61 } |
| 61 | 62 |
| 62 void OfflinePageNotificationBridge::NotifyDownloadPaused( | 63 void OfflinePageNotificationBridge::NotifyDownloadPaused( |
| 63 const DownloadUIItem& item) { | 64 const DownloadUIItem& item) { |
| 64 JNIEnv* env = AttachCurrentThread(); | 65 JNIEnv* env = AttachCurrentThread(); |
| 65 Java_OfflinePageNotificationBridge_notifyDownloadPaused( | 66 Java_OfflinePageNotificationBridge_notifyDownloadPaused( |
| 66 env, GetApplicationContext(), ConvertUTF8ToJavaString(env, item.guid), | 67 env, GetApplicationContext(), ConvertUTF8ToJavaString(env, item.guid), |
| 67 GetDisplayName(item)); | 68 GetDisplayName(item)); |
| 68 } | 69 } |
| 69 | 70 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 83 } | 84 } |
| 84 | 85 |
| 85 void OfflinePageNotificationBridge::ShowDownloadingToast() { | 86 void OfflinePageNotificationBridge::ShowDownloadingToast() { |
| 86 JNIEnv* env = AttachCurrentThread(); | 87 JNIEnv* env = AttachCurrentThread(); |
| 87 Java_OfflinePageNotificationBridge_showDownloadingToast( | 88 Java_OfflinePageNotificationBridge_showDownloadingToast( |
| 88 env, GetApplicationContext()); | 89 env, GetApplicationContext()); |
| 89 } | 90 } |
| 90 | 91 |
| 91 } // namespace android | 92 } // namespace android |
| 92 } // namespace offline_pages | 93 } // namespace offline_pages |
| OLD | NEW |