OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_AUTOFILL_AUTOFILL_DIALOG_RESULT_H_ | 5 #ifndef CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_DIALOG_RESULT_H_ |
6 #define CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_DIALOG_RESULT_H_ | 6 #define CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_DIALOG_RESULT_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
| 9 |
| 10 #include <memory> |
9 #include <string> | 11 #include <string> |
10 | 12 |
11 #include "base/macros.h" | 13 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
14 | 15 |
15 namespace autofill { | 16 namespace autofill { |
16 namespace wallet { | 17 namespace wallet { |
17 class FullWallet; | 18 class FullWallet; |
18 } | 19 } |
19 } | 20 } |
20 | 21 |
21 namespace autofill { | 22 namespace autofill { |
22 | 23 |
23 // A result of the non-cancelled Java-side AutofillDialog invocation. | 24 // A result of the non-cancelled Java-side AutofillDialog invocation. |
24 // Passed to the AutofillDialogControllerAndroid in dialogContinue. | 25 // Passed to the AutofillDialogControllerAndroid in dialogContinue. |
25 class AutofillDialogResult { | 26 class AutofillDialogResult { |
26 public: | 27 public: |
27 // Converts the requested information to wallet::FullWallet. | 28 // Converts the requested information to wallet::FullWallet. |
28 // The dialog stores the requested information in the same format | 29 // The dialog stores the requested information in the same format |
29 // regardless if the information was obtained from Autofill or Google Wallet. | 30 // regardless if the information was obtained from Autofill or Google Wallet. |
30 static scoped_ptr<wallet::FullWallet> ConvertFromJava( | 31 static std::unique_ptr<wallet::FullWallet> ConvertFromJava(JNIEnv* env, |
31 JNIEnv* env, jobject wallet); | 32 jobject wallet); |
32 | 33 |
33 // Returns the email address to be associated with this request, | 34 // Returns the email address to be associated with this request, |
34 // or an empty string. | 35 // or an empty string. |
35 static base::string16 GetWalletEmail(JNIEnv* env, jobject wallet); | 36 static base::string16 GetWalletEmail(JNIEnv* env, jobject wallet); |
36 | 37 |
37 // Returns the Google Transaction ID to be associated with this request, | 38 // Returns the Google Transaction ID to be associated with this request, |
38 // or an empty string. | 39 // or an empty string. |
39 static std::string GetWalletGoogleTransactionId(JNIEnv* env, jobject wallet); | 40 static std::string GetWalletGoogleTransactionId(JNIEnv* env, jobject wallet); |
40 | 41 |
41 // Establishes JNI bindings. | 42 // Establishes JNI bindings. |
42 static bool RegisterAutofillDialogResult(JNIEnv* env); | 43 static bool RegisterAutofillDialogResult(JNIEnv* env); |
43 | 44 |
44 private: | 45 private: |
45 DISALLOW_COPY_AND_ASSIGN(AutofillDialogResult); | 46 DISALLOW_COPY_AND_ASSIGN(AutofillDialogResult); |
46 }; | 47 }; |
47 | 48 |
48 } // namespace autofill | 49 } // namespace autofill |
49 | 50 |
50 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_DIALOG_RESULT_H_ | 51 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_DIALOG_RESULT_H_ |
OLD | NEW |