| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_ANDROID_INFOBARS_DOWNLOAD_OVERWRITE_INFOBAR_H_ | 5 #ifndef CHROME_BROWSER_UI_ANDROID_INFOBARS_DOWNLOAD_OVERWRITE_INFOBAR_H_ |
| 6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_DOWNLOAD_OVERWRITE_INFOBAR_H_ | 6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_DOWNLOAD_OVERWRITE_INFOBAR_H_ |
| 7 | 7 |
| 8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "chrome/browser/ui/android/infobars/infobar_android.h" | 10 #include "chrome/browser/ui/android/infobars/infobar_android.h" |
| 11 | 11 |
| 12 namespace chrome { | 12 namespace chrome { |
| 13 namespace android { | 13 namespace android { |
| 14 class DownloadOverwriteInfoBarDelegate; | 14 class DownloadOverwriteInfoBarDelegate; |
| 15 } | 15 } |
| 16 } | 16 } |
| 17 | 17 |
| 18 // A native-side implementation of an infobar to ask whether to overwrite | 18 // A native-side implementation of an infobar to ask whether to overwrite |
| 19 // an existing file with a new download. | 19 // an existing file with a new download. |
| 20 class DownloadOverwriteInfoBar : public InfoBarAndroid { | 20 class DownloadOverwriteInfoBar : public InfoBarAndroid { |
| 21 public: | 21 public: |
| 22 static scoped_ptr<infobars::InfoBar> CreateInfoBar( | 22 static std::unique_ptr<infobars::InfoBar> CreateInfoBar( |
| 23 scoped_ptr<chrome::android::DownloadOverwriteInfoBarDelegate> delegate); | 23 std::unique_ptr<chrome::android::DownloadOverwriteInfoBarDelegate> |
| 24 delegate); |
| 24 ~DownloadOverwriteInfoBar() override; | 25 ~DownloadOverwriteInfoBar() override; |
| 25 | 26 |
| 26 private: | 27 private: |
| 27 explicit DownloadOverwriteInfoBar( | 28 explicit DownloadOverwriteInfoBar( |
| 28 scoped_ptr<chrome::android::DownloadOverwriteInfoBarDelegate> delegate); | 29 std::unique_ptr<chrome::android::DownloadOverwriteInfoBarDelegate> |
| 30 delegate); |
| 29 | 31 |
| 30 // InfoBarAndroid: | 32 // InfoBarAndroid: |
| 31 base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar( | 33 base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar( |
| 32 JNIEnv* env) override; | 34 JNIEnv* env) override; |
| 33 void ProcessButton(int action) override; | 35 void ProcessButton(int action) override; |
| 34 | 36 |
| 35 chrome::android::DownloadOverwriteInfoBarDelegate* GetDelegate(); | 37 chrome::android::DownloadOverwriteInfoBarDelegate* GetDelegate(); |
| 36 | 38 |
| 37 DISALLOW_COPY_AND_ASSIGN(DownloadOverwriteInfoBar); | 39 DISALLOW_COPY_AND_ASSIGN(DownloadOverwriteInfoBar); |
| 38 }; | 40 }; |
| 39 | 41 |
| 40 // Registers the native methods through JNI. | 42 // Registers the native methods through JNI. |
| 41 bool RegisterDownloadOverwriteInfoBarDelegate(JNIEnv* env); | 43 bool RegisterDownloadOverwriteInfoBarDelegate(JNIEnv* env); |
| 42 | 44 |
| 43 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_DOWNLOAD_OVERWRITE_INFOBAR_H_ | 45 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_DOWNLOAD_OVERWRITE_INFOBAR_H_ |
| OLD | NEW |