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

Unified Diff: chrome/browser/ui/android/infobars/download_overwrite_infobar.h

Issue 580043002: [Android] Prompt with infobar on filename conflict (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed pkasting@'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/ui/android/infobars/download_overwrite_infobar.h
diff --git a/chrome/browser/ui/android/infobars/download_overwrite_infobar.h b/chrome/browser/ui/android/infobars/download_overwrite_infobar.h
new file mode 100644
index 0000000000000000000000000000000000000000..e8cde32cd73df530a7b87c3e00a9b83cba0a187b
--- /dev/null
+++ b/chrome/browser/ui/android/infobars/download_overwrite_infobar.h
@@ -0,0 +1,45 @@
+// 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_UI_ANDROID_INFOBARS_DOWNLOAD_OVERWRITE_INFOBAR_H_
+#define CHROME_BROWSER_UI_ANDROID_INFOBARS_DOWNLOAD_OVERWRITE_INFOBAR_H_
+
+#include "base/android/scoped_java_ref.h"
+#include "base/basictypes.h"
+#include "chrome/browser/ui/android/infobars/infobar_android.h"
+
+namespace chrome {
+namespace android {
+class DownloadOverwriteInfoBarDelegate;
+}
+}
+
+// A native-side implementation of an infobar to ask whether to overwrite
+// an existing file with a new download.
+class DownloadOverwriteInfoBar : public InfoBarAndroid {
+ public:
+ static scoped_ptr<infobars::InfoBar> CreateInfoBar(
+ scoped_ptr<chrome::android::DownloadOverwriteInfoBarDelegate> delegate);
+ ~DownloadOverwriteInfoBar() override;
+
+ private:
+ explicit DownloadOverwriteInfoBar(
+ scoped_ptr<chrome::android::DownloadOverwriteInfoBarDelegate> delegate);
+
+ // InfoBarAndroid:
+ base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar(JNIEnv* env)
+ override;
+ void ProcessButton(int action, const std::string& action_value) override;
+
+ chrome::android::DownloadOverwriteInfoBarDelegate* GetDelegate();
+
+ base::android::ScopedJavaGlobalRef<jobject> java_delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(DownloadOverwriteInfoBar);
+};
+
+// Registers the native methods through JNI.
+bool RegisterDownloadOverwriteInfoBarDelegate(JNIEnv* env);
+
+#endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_DOWNLOAD_OVERWRITE_INFOBAR_H_

Powered by Google App Engine
This is Rietveld 408576698