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

Unified Diff: chrome/browser/android/download/download_overwrite_infobar_delegate_java_initiated.h

Issue 580043002: [Android] Prompt with infobar on filename conflict (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: avoided Java-only infobar Created 5 years, 10 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/download_overwrite_infobar_delegate_java_initiated.h
diff --git a/chrome/browser/android/download/download_overwrite_infobar_delegate_java_initiated.h b/chrome/browser/android/download/download_overwrite_infobar_delegate_java_initiated.h
new file mode 100644
index 0000000000000000000000000000000000000000..dea15ca5a906eb1c009edddf467e2cd06dbd51d5
--- /dev/null
+++ b/chrome/browser/android/download/download_overwrite_infobar_delegate_java_initiated.h
@@ -0,0 +1,60 @@
+// Copyright 2015 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_DOWNLOAD_OVERWRITE_INFOBAR_DELEGATE_JAVA_INITIATED_H_
+#define CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_OVERWRITE_INFOBAR_DELEGATE_JAVA_INITIATED_H_
+
+#include "base/callback.h"
+#include "base/files/file_path.h"
+#include "chrome/browser/android/download/download_overwrite_info.h"
+#include "chrome/browser/android/download/download_overwrite_infobar_delegate.h"
+#include "components/infobars/core/infobar_delegate.h"
+
+class InfoBarService;
+
+namespace chrome {
+namespace android {
+
+// An infobar delegate that is initiated from Java side.
+class DownloadOverwriteInfoBarDelegateJavaInitiated
Ted C 2015/02/26 00:57:56 The names of these two files is odd to me. Is the
Changwan Ryu 2015/03/02 14:46:36 Done.
+ : public DownloadOverwriteInfoBarDelegate {
+ public:
+ ~DownloadOverwriteInfoBarDelegateJavaInitiated() override;
+
+ typedef base::Callback<void(const DownloadOverwriteInfo&)>
Peter Kasting 2015/02/25 06:24:57 Typedefs go above members
Changwan Ryu 2015/03/02 14:46:36 I see. Removed now since the callback use case is
+ FileSelectedFromDownloadOverwriteInfoCallback;
Peter Kasting 2015/02/25 06:24:57 Nit: This name seems a bit verbose, can you shorte
Changwan Ryu 2015/03/02 14:46:36 Ditto
+
+ static void Create(InfoBarService* infobar_service,
+ const DownloadOverwriteInfo& info,
+ const FileSelectedFromDownloadOverwriteInfoCallback&
+ file_selected_callback);
+
+ void OverwriteExistingFile() override;
Peter Kasting 2015/02/25 06:24:57 Nit: "// DownloadOverwriteInfoBarDelegate:" How c
Changwan Ryu 2015/03/02 14:46:36 Done.
+ void CreateNewFile() override;
+ std::string GetFileName() const override;
+ std::string GetDirName() const override;
+ std::string GetDirFullPath() const override;
+
+ private:
+ DownloadOverwriteInfoBarDelegateJavaInitiated(
+ const DownloadOverwriteInfo& info,
+ const FileSelectedFromDownloadOverwriteInfoCallback& callback);
+
+ // infobars::InfoBarDelegateForDownloadOverwriteInfo:
Peter Kasting 2015/02/25 06:24:57 This is not a class name? And if you meant to wri
Changwan Ryu 2015/03/02 14:46:36 Done.
+ bool ShouldExpire(const infobars::InfoBarDelegate::NavigationDetails& details)
+ const override;
+ void InfoBarDismissed() override;
+
+ DownloadOverwriteInfo download_overwrite_info_;
+
+ // A callback to notify that file selection is made (or cancelled).
+ FileSelectedFromDownloadOverwriteInfoCallback file_selected_callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(DownloadOverwriteInfoBarDelegateJavaInitiated);
+};
+
+} // namespace android
+} // namespace chrome
+
+#endif // CHROME_BROWSER_ANDROID_DOWNLOAD_DOWNLOAD_OVERWRITE_INFOBAR_DELEGATE_JAVA_INITIATED_H_

Powered by Google App Engine
This is Rietveld 408576698