Index: chrome/browser/android/download/chrome_duplicate_download_infobar_delegate.h |
diff --git a/chrome/browser/android/download/chrome_download_manager_overwrite_infobar_delegate.h b/chrome/browser/android/download/chrome_duplicate_download_infobar_delegate.h |
similarity index 56% |
rename from chrome/browser/android/download/chrome_download_manager_overwrite_infobar_delegate.h |
rename to chrome/browser/android/download/chrome_duplicate_download_infobar_delegate.h |
index 30e8bfe67dadb188ae09a100cb684020848bf050..fae2f5255bb6d7982eec5c05fe493374e9a5f6c4 100644 |
--- a/chrome/browser/android/download/chrome_download_manager_overwrite_infobar_delegate.h |
+++ b/chrome/browser/android/download/chrome_duplicate_download_infobar_delegate.h |
@@ -2,37 +2,34 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_OVERWRITE_INFOBAR_DELEGATE_H_ |
-#define CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_OVERWRITE_INFOBAR_DELEGATE_H_ |
+#ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE_H_ |
+#define CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE_H_ |
-#include "base/android/scoped_java_ref.h" |
#include "base/callback.h" |
#include "base/files/file_path.h" |
#include "base/macros.h" |
-#include "chrome/browser/android/download/download_overwrite_infobar_delegate.h" |
-#include "chrome/browser/download/download_path_reservation_tracker.h" |
+#include "chrome/browser/android/download/duplicate_download_infobar_delegate.h" |
#include "chrome/browser/download/download_target_determiner_delegate.h" |
#include "components/infobars/core/infobar_delegate.h" |
#include "content/public/browser/download_item.h" |
-using base::android::ScopedJavaGlobalRef; |
- |
class InfoBarService; |
namespace chrome { |
namespace android { |
// An infobar delegate that starts from the given file path. |
-class ChromeDownloadManagerOverwriteInfoBarDelegate |
- : public DownloadOverwriteInfoBarDelegate, |
+class ChromeDuplicateDownloadInfoBarDelegate |
+ : public DuplicateDownloadInfoBarDelegate, |
public content::DownloadItem::Observer { |
public: |
- ~ChromeDownloadManagerOverwriteInfoBarDelegate() override; |
+ ~ChromeDuplicateDownloadInfoBarDelegate() override; |
static void Create( |
InfoBarService* infobar_service, |
content::DownloadItem* download_item, |
- const base::FilePath& suggested_download_path, |
+ const base::FilePath& file_path, |
+ bool is_off_the_record, |
const DownloadTargetDeterminerDelegate::FileSelectedCallback& |
file_selected_callback); |
@@ -40,37 +37,41 @@ class ChromeDownloadManagerOverwriteInfoBarDelegate |
void OnDownloadDestroyed(content::DownloadItem* download_item) override; |
private: |
- ChromeDownloadManagerOverwriteInfoBarDelegate( |
+ ChromeDuplicateDownloadInfoBarDelegate( |
content::DownloadItem* download_item, |
- const base::FilePath& suggested_path, |
+ const base::FilePath& file_path, |
+ bool is_off_the_record, |
const DownloadTargetDeterminerDelegate::FileSelectedCallback& callback); |
// DownloadOverwriteInfoBarDelegate: |
infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; |
- bool OverwriteExistingFile() override; |
- bool CreateNewFile() override; |
- std::string GetFileName() const override; |
- std::string GetDirName() const override; |
- std::string GetDirFullPath() const override; |
+ bool Accept() override; |
+ bool Cancel() override; |
+ std::string GetFilePath() const override; |
void InfoBarDismissed() override; |
+ bool IsOffTheRecord() const override; |
+ |
// The download item that is requesting the infobar. Could get deleted while |
// the infobar is showing. |
content::DownloadItem* download_item_; |
- // The suggested download path from download target determiner. This is used |
- // to show users the file name and the directory that will be used. |
- base::FilePath suggested_download_path_; |
+ // The target file path to be downloaded. This is used to show users the |
+ // file name that will be used. |
+ base::FilePath file_path_; |
+ |
+ // Whether the download is off the record. |
+ bool is_off_the_record_; |
// A callback to download target determiner to notify that file selection |
// is made (or cancelled). |
DownloadTargetDeterminerDelegate::FileSelectedCallback |
file_selected_callback_; |
- DISALLOW_COPY_AND_ASSIGN(ChromeDownloadManagerOverwriteInfoBarDelegate); |
+ DISALLOW_COPY_AND_ASSIGN(ChromeDuplicateDownloadInfoBarDelegate); |
}; |
} // namespace android |
} // namespace chrome |
-#endif // CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_OVERWRITE_INFOBAR_DELEGATE_H_ |
+#endif // CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE_H_ |