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

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: addressed ted's comments 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..543b758c6a4e06c3f19d124025b3d9360a538379
--- /dev/null
+++ b/chrome/browser/android/download_overwrite_infobar_delegate.h
@@ -0,0 +1,61 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// 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 {
+
+// An infobar delegate for DownloadOverwriteInfoBar implemented for
+// use by ChromeDownloadManagerDelegate.
Peter Kasting 2014/10/24 01:32:22 Nit: Maybe instead of a comment that's a bunch of
Changwan Ryu 2014/10/27 06:40:04 Done.
+class DownloadOverwriteInfoBarDelegate : public infobars::InfoBarDelegate {
+ public:
+ // Callback to be invoked when PromptUserForDownloadPath() completes.
+ // Originally defined in download_target_determiner_delegate.h, but
+ // redefined to avoid a template-related compile error.
Peter Kasting 2014/10/24 01:32:22 What error? I'm confused why this needs to be her
Changwan Ryu 2014/10/27 06:40:04 Hmm... Removed as the compiler error isn't reprodu
+ typedef base::Callback<void(const base::FilePath& virtual_path)>
+ FileSelectedCallback;
+ virtual ~DownloadOverwriteInfoBarDelegate();
Peter Kasting 2014/10/24 01:32:22 Nit: Blank line above and below this so each type
Peter Kasting 2014/10/24 01:32:22 Nit: "override" rather than "virtual"
Changwan Ryu 2014/10/27 06:40:04 Done.
Changwan Ryu 2014/10/27 06:40:04 Done.
+ static infobars::InfoBar* Create(
+ content::DownloadItem* download,
+ const base::FilePath& suggested_path,
+ const FileSelectedCallback& callback);
+
+ // InfoBarDelegate:
+ virtual DownloadOverwriteInfoBarDelegate*
Peter Kasting 2014/10/24 01:32:22 Nit: No "virtual" when "override" is present
Changwan Ryu 2014/10/27 06:40:04 Done.
+ AsDownloadOverwriteInfoBarDelegate() override;
+
+ bool Accept();
Peter Kasting 2014/10/24 01:32:22 Nit: Say what Accept() and Cancel() do. Perhaps y
Changwan Ryu 2014/10/27 06:40:04 Done.
+ bool Cancel();
+ std::string GetFileName() const;
+ std::string GetDirName() const;
+ std::string GetDirFullPath() const;
+
+ protected:
+ DownloadOverwriteInfoBarDelegate(
Peter Kasting 2014/10/24 01:32:22 Why is this protected rather than private? No one
Changwan Ryu 2014/10/27 06:40:04 Done.
+ content::DownloadItem* download,
+ const base::FilePath& suggested_path,
+ const FileSelectedCallback& callback);
+
+ private:
+ int pending_id_;
Peter Kasting 2014/10/24 01:32:22 Nit: Document these.
Changwan Ryu 2014/10/27 06:40:04 Done.
+ 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