Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / ui / android / infobars / download_overwrite_infobar.h
blob67a949b7415fe1b70bf0fd5aaf07956781819390
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_ANDROID_INFOBARS_DOWNLOAD_OVERWRITE_INFOBAR_H_
6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_DOWNLOAD_OVERWRITE_INFOBAR_H_
8 #include "base/android/scoped_java_ref.h"
9 #include "base/basictypes.h"
10 #include "chrome/browser/ui/android/infobars/infobar_android.h"
12 namespace chrome {
13 namespace android {
14 class DownloadOverwriteInfoBarDelegate;
18 // A native-side implementation of an infobar to ask whether to overwrite
19 // an existing file with a new download.
20 class DownloadOverwriteInfoBar : public InfoBarAndroid {
21 public:
22 static scoped_ptr<infobars::InfoBar> CreateInfoBar(
23 scoped_ptr<chrome::android::DownloadOverwriteInfoBarDelegate> delegate);
24 ~DownloadOverwriteInfoBar() override;
26 private:
27 explicit DownloadOverwriteInfoBar(
28 scoped_ptr<chrome::android::DownloadOverwriteInfoBarDelegate> delegate);
30 // InfoBarAndroid:
31 base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar(
32 JNIEnv* env) override;
33 void ProcessButton(int action, const std::string& action_value) override;
35 chrome::android::DownloadOverwriteInfoBarDelegate* GetDelegate();
37 DISALLOW_COPY_AND_ASSIGN(DownloadOverwriteInfoBar);
40 // Registers the native methods through JNI.
41 bool RegisterDownloadOverwriteInfoBarDelegate(JNIEnv* env);
43 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_DOWNLOAD_OVERWRITE_INFOBAR_H_