OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_AUTOFILL_SAVE_CARD_INFOBAR_H_ | 5 #ifndef CHROME_BROWSER_UI_ANDROID_INFOBARS_AUTOFILL_SAVE_CARD_INFOBAR_H_ |
6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_AUTOFILL_SAVE_CARD_INFOBAR_H_ | 6 #define CHROME_BROWSER_UI_ANDROID_INFOBARS_AUTOFILL_SAVE_CARD_INFOBAR_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
| 10 #include <memory> |
| 11 |
10 #include "base/macros.h" | 12 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "chrome/browser/ui/android/infobars/confirm_infobar.h" | 13 #include "chrome/browser/ui/android/infobars/confirm_infobar.h" |
13 | 14 |
14 namespace autofill { | 15 namespace autofill { |
15 class AutofillSaveCardInfoBarDelegateMobile; | 16 class AutofillSaveCardInfoBarDelegateMobile; |
16 } | 17 } |
17 | 18 |
18 // Android implementation of the infobar for saving credit card information. | 19 // Android implementation of the infobar for saving credit card information. |
19 class AutofillSaveCardInfoBar : public ConfirmInfoBar { | 20 class AutofillSaveCardInfoBar : public ConfirmInfoBar { |
20 public: | 21 public: |
21 explicit AutofillSaveCardInfoBar( | 22 explicit AutofillSaveCardInfoBar( |
22 scoped_ptr<autofill::AutofillSaveCardInfoBarDelegateMobile> delegate); | 23 std::unique_ptr<autofill::AutofillSaveCardInfoBarDelegateMobile> |
| 24 delegate); |
23 ~AutofillSaveCardInfoBar() override; | 25 ~AutofillSaveCardInfoBar() override; |
24 | 26 |
25 // Called when a link in the legal message text was clicked. | 27 // Called when a link in the legal message text was clicked. |
26 void OnLegalMessageLinkClicked(JNIEnv* env, jobject obj, jstring url); | 28 void OnLegalMessageLinkClicked(JNIEnv* env, jobject obj, jstring url); |
27 | 29 |
28 // Registers the JNI bindings. | 30 // Registers the JNI bindings. |
29 static bool Register(JNIEnv* env); | 31 static bool Register(JNIEnv* env); |
30 | 32 |
31 private: | 33 private: |
32 // ConfirmInfoBar: | 34 // ConfirmInfoBar: |
33 base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar( | 35 base::android::ScopedJavaLocalRef<jobject> CreateRenderInfoBar( |
34 JNIEnv* env) override; | 36 JNIEnv* env) override; |
35 | 37 |
36 // Returns the infobar delegate. | 38 // Returns the infobar delegate. |
37 autofill::AutofillSaveCardInfoBarDelegateMobile* GetSaveCardDelegate(); | 39 autofill::AutofillSaveCardInfoBarDelegateMobile* GetSaveCardDelegate(); |
38 | 40 |
39 DISALLOW_COPY_AND_ASSIGN(AutofillSaveCardInfoBar); | 41 DISALLOW_COPY_AND_ASSIGN(AutofillSaveCardInfoBar); |
40 }; | 42 }; |
41 | 43 |
42 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_AUTOFILL_SAVE_CARD_INFOBAR_H_ | 44 #endif // CHROME_BROWSER_UI_ANDROID_INFOBARS_AUTOFILL_SAVE_CARD_INFOBAR_H_ |
OLD | NEW |