OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_ANDROID_DOWNLOAD_MANAGER_OVERWRITE_INFOB
AR_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_ANDROID_DOWNLOAD_MANAGER_OVERWRITE_INFOB
AR_DELEGATE_H_ |
| 7 |
| 8 #include "base/android/jni_weak_ref.h" |
| 9 #include "base/android/scoped_java_ref.h" |
| 10 #include "base/callback.h" |
| 11 #include "base/files/file_path.h" |
| 12 #include "chrome/browser/android/download/download_overwrite_infobar_delegate.h" |
| 13 #include "components/infobars/core/infobar_delegate.h" |
| 14 |
| 15 class InfoBarService; |
| 16 |
| 17 namespace chrome { |
| 18 namespace android { |
| 19 |
| 20 // An infobar delegate that is initiated from Java side. |
| 21 class AndroidDownloadManagerOverwriteInfoBarDelegate |
| 22 : public DownloadOverwriteInfoBarDelegate { |
| 23 public: |
| 24 ~AndroidDownloadManagerOverwriteInfoBarDelegate() override; |
| 25 |
| 26 static void Create(InfoBarService* infobar_service, |
| 27 const std::string& file_name, |
| 28 const std::string& dir_name, |
| 29 const std::string& dir_full_path, |
| 30 jobject chrome_download_delegate, |
| 31 jobject download_info); |
| 32 |
| 33 private: |
| 34 AndroidDownloadManagerOverwriteInfoBarDelegate( |
| 35 const std::string& file_name, |
| 36 const std::string& dir_name, |
| 37 const std::string& dir_full_path, |
| 38 jobject chrome_download_delegate, |
| 39 jobject download_info); |
| 40 |
| 41 // DownloadOverwriteInfoBarDelegate: |
| 42 void OverwriteExistingFile() override; |
| 43 void CreateNewFile() override; |
| 44 std::string GetFileName() const override; |
| 45 std::string GetDirName() const override; |
| 46 std::string GetDirFullPath() const override; |
| 47 |
| 48 std::string file_name_; |
| 49 std::string dir_name_; |
| 50 std::string dir_full_path_; |
| 51 base::android::ScopedJavaGlobalRef<jobject> chrome_download_delegate_; |
| 52 base::android::ScopedJavaGlobalRef<jobject> download_info_; |
| 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(AndroidDownloadManagerOverwriteInfoBarDelegate); |
| 55 }; |
| 56 |
| 57 } // namespace android |
| 58 } // namespace chrome |
| 59 |
| 60 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_ANDROID_DOWNLOAD_MANAGER_OVERWRITE_IN
FOBAR_DELEGATE_H_ |
OLD | NEW |