| 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 #ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_OVERWRITE_INFOBA
R_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_OVERWRITE_INFOBA
R_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_OVERWRITE_INFOBA
R_DELEGATE_H_ | 6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_OVERWRITE_INFOBA
R_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 const base::FilePath& suggested_download_path, | 30 const base::FilePath& suggested_download_path, |
| 31 const DownloadTargetDeterminerDelegate::FileSelectedCallback& | 31 const DownloadTargetDeterminerDelegate::FileSelectedCallback& |
| 32 file_selected_callback); | 32 file_selected_callback); |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 ChromeDownloadManagerOverwriteInfoBarDelegate( | 35 ChromeDownloadManagerOverwriteInfoBarDelegate( |
| 36 const base::FilePath& suggested_path, | 36 const base::FilePath& suggested_path, |
| 37 const DownloadTargetDeterminerDelegate::FileSelectedCallback& callback); | 37 const DownloadTargetDeterminerDelegate::FileSelectedCallback& callback); |
| 38 | 38 |
| 39 // DownloadOverwriteInfoBarDelegate: | 39 // DownloadOverwriteInfoBarDelegate: |
| 40 std::string GetIdentifier() const override; |
| 40 bool OverwriteExistingFile() override; | 41 bool OverwriteExistingFile() override; |
| 41 bool CreateNewFile() override; | 42 bool CreateNewFile() override; |
| 42 std::string GetFileName() const override; | 43 std::string GetFileName() const override; |
| 43 std::string GetDirName() const override; | 44 std::string GetDirName() const override; |
| 44 std::string GetDirFullPath() const override; | 45 std::string GetDirFullPath() const override; |
| 45 void InfoBarDismissed() override; | 46 void InfoBarDismissed() override; |
| 46 | 47 |
| 47 // Called on the FILE thread to create a new file. Calls |callback| on the UI | 48 // Called on the FILE thread to create a new file. Calls |callback| on the UI |
| 48 // thread when finished. | 49 // thread when finished. |
| 49 static void CreateNewFileInternal( | 50 static void CreateNewFileInternal( |
| 50 const base::FilePath& suggested_download_path, | 51 const base::FilePath& suggested_download_path, |
| 51 const DownloadTargetDeterminerDelegate::FileSelectedCallback& callback); | 52 const DownloadTargetDeterminerDelegate::FileSelectedCallback& callback); |
| 52 | 53 |
| 53 // The suggested download path from download target determiner. This is used | 54 // The suggested download path from download target determiner. This is used |
| 54 // to show users the file name and the directory that will be used. | 55 // to show users the file name and the directory that will be used. |
| 55 base::FilePath suggested_download_path_; | 56 base::FilePath suggested_download_path_; |
| 56 | 57 |
| 57 // A callback to download target determiner to notify that file selection | 58 // A callback to download target determiner to notify that file selection |
| 58 // is made (or cancelled). | 59 // is made (or cancelled). |
| 59 DownloadTargetDeterminerDelegate::FileSelectedCallback | 60 DownloadTargetDeterminerDelegate::FileSelectedCallback |
| 60 file_selected_callback_; | 61 file_selected_callback_; |
| 61 | 62 |
| 62 DISALLOW_COPY_AND_ASSIGN(ChromeDownloadManagerOverwriteInfoBarDelegate); | 63 DISALLOW_COPY_AND_ASSIGN(ChromeDownloadManagerOverwriteInfoBarDelegate); |
| 63 }; | 64 }; |
| 64 | 65 |
| 65 } // namespace android | 66 } // namespace android |
| 66 } // namespace chrome | 67 } // namespace chrome |
| 67 | 68 |
| 68 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_OVERWRITE_INF
OBAR_DELEGATE_H_ | 69 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_OVERWRITE_INF
OBAR_DELEGATE_H_ |
| OLD | NEW |