Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(803)

Unified Diff: chrome/browser/android/download_overwrite_infobar_delegate.h

Issue 580043002: [Android] Prompt with infobar on filename conflict (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: full implementation Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/download_overwrite_infobar_delegate.h
diff --git a/chrome/browser/android/download_overwrite_infobar_delegate.h b/chrome/browser/android/download_overwrite_infobar_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..c4de0739930b98c99d769d524a74d82e5a44a206
--- /dev/null
+++ b/chrome/browser/android/download_overwrite_infobar_delegate.h
@@ -0,0 +1,56 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
Ted C 2014/10/14 01:25:37 no (c)
Changwan Ryu 2014/10/14 04:04:40 Done.
+// 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_OVERWRITE_INFOBAR_DELEGATE_H_
+#define CHROME_BROWSER_ANDROID_DOWNLOAD_OVERWRITE_INFOBAR_DELEGATE_H_
+
+#include "base/callback.h"
+#include "base/files/file_path.h"
+#include "components/infobars/core/infobar_delegate.h"
+
+namespace content {
+class DownloadItem;
+}
+
+namespace chrome {
+namespace android {
+
+class DownloadOverwriteInfoBarDelegate : public infobars::InfoBarDelegate {
Ted C 2014/10/14 01:25:37 Similar question about whether we should be using
Changwan Ryu 2014/10/14 04:04:40 As explained elsewhere, this requires some unique
+ public:
+ typedef base::Callback<void(const base::FilePath& virtual_path)>
+ FileSelectedCallback;
+ virtual ~DownloadOverwriteInfoBarDelegate();
+ static infobars::InfoBar* Create(
+ content::DownloadItem* download,
+ const base::FilePath& suggested_path,
+ const FileSelectedCallback& callback);
+
+ // InfoBarDelegate:
+ virtual DownloadOverwriteInfoBarDelegate*
+ AsDownloadOverwriteInfoBarDelegate() override;
+
+ bool Accept();
+ bool Cancel();
+ std::string GetFileName() const;
+ std::string GetDirName() const;
+ std::string GetDirFullPath() const;
+
+ protected:
+ DownloadOverwriteInfoBarDelegate(
+ content::DownloadItem* download,
+ const base::FilePath& suggested_path,
+ const FileSelectedCallback& callback);
+
+ private:
+ int pending_id_;
+ base::FilePath suggested_path_;
+ FileSelectedCallback callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(DownloadOverwriteInfoBarDelegate);
+};
+
+} // namespace android
+} // namespace chrome
+
+#endif // CHROME_BROWSER_ANDROID_DOWNLOAD_OVERWRITE_INFOBAR_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698