| 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/ui/android/infobars/duplicate_download_infobar.h" | 5 #include "chrome/browser/ui/android/infobars/duplicate_download_infobar.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 : ConfirmInfoBar(std::move(delegate)) {} | 28 : ConfirmInfoBar(std::move(delegate)) {} |
| 29 | 29 |
| 30 base::android::ScopedJavaLocalRef<jobject> | 30 base::android::ScopedJavaLocalRef<jobject> |
| 31 DuplicateDownloadInfoBar::CreateRenderInfoBar(JNIEnv* env) { | 31 DuplicateDownloadInfoBar::CreateRenderInfoBar(JNIEnv* env) { |
| 32 DuplicateDownloadInfoBarDelegate* delegate = GetDelegate(); | 32 DuplicateDownloadInfoBarDelegate* delegate = GetDelegate(); |
| 33 | 33 |
| 34 base::android::ScopedJavaLocalRef<jstring> j_file_path = | 34 base::android::ScopedJavaLocalRef<jstring> j_file_path = |
| 35 base::android::ConvertUTF8ToJavaString(env, delegate->GetFilePath()); | 35 base::android::ConvertUTF8ToJavaString(env, delegate->GetFilePath()); |
| 36 base::android::ScopedJavaLocalRef<jstring> j_page_url = | 36 base::android::ScopedJavaLocalRef<jstring> j_page_url = |
| 37 base::android::ConvertUTF8ToJavaString(env, delegate->GetPageURL()); | 37 base::android::ConvertUTF8ToJavaString(env, delegate->GetPageURL()); |
| 38 base::android::ScopedJavaLocalRef<jstring> j_download_guid = |
| 39 base::android::ConvertUTF8ToJavaString(env, delegate->GetDownloadGuid()); |
| 38 base::android::ScopedJavaLocalRef<jobject> java_infobar( | 40 base::android::ScopedJavaLocalRef<jobject> java_infobar( |
| 39 Java_DuplicateDownloadInfoBar_createInfoBar( | 41 Java_DuplicateDownloadInfoBar_createInfoBar( |
| 40 env, j_file_path, delegate->IsOfflinePage(), j_page_url, | 42 env, j_file_path, delegate->IsOfflinePage(), j_page_url, |
| 41 delegate->IsOffTheRecord())); | 43 delegate->IsOffTheRecord(), j_download_guid)); |
| 42 return java_infobar; | 44 return java_infobar; |
| 43 } | 45 } |
| 44 | 46 |
| 45 DuplicateDownloadInfoBarDelegate* DuplicateDownloadInfoBar::GetDelegate() { | 47 DuplicateDownloadInfoBarDelegate* DuplicateDownloadInfoBar::GetDelegate() { |
| 46 return static_cast<DuplicateDownloadInfoBarDelegate*>(delegate()); | 48 return static_cast<DuplicateDownloadInfoBarDelegate*>(delegate()); |
| 47 } | 49 } |
| OLD | NEW |