Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / ui / android / autofill / autofill_dialog_result.h
blob2fe26a9e7c2f0d2f6f3c93648887bb61113e96e7
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_DIALOG_RESULT_H_
6 #define CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_DIALOG_RESULT_H_
8 #include <jni.h>
9 #include <string>
11 #include "base/memory/scoped_ptr.h"
12 #include "base/strings/string16.h"
14 namespace autofill {
15 namespace wallet {
16 class FullWallet;
20 namespace autofill {
22 // A result of the non-cancelled Java-side AutofillDialog invocation.
23 // Passed to the AutofillDialogControllerAndroid in dialogContinue.
24 class AutofillDialogResult {
25 public:
26 // Converts the requested information to wallet::FullWallet.
27 // The dialog stores the requested information in the same format
28 // regardless if the information was obtained from Autofill or Google Wallet.
29 static scoped_ptr<wallet::FullWallet> ConvertFromJava(
30 JNIEnv* env, jobject wallet);
32 // Returns the email address to be associated with this request,
33 // or an empty string.
34 static base::string16 GetWalletEmail(JNIEnv* env, jobject wallet);
36 // Returns the Google Transaction ID to be associated with this request,
37 // or an empty string.
38 static std::string GetWalletGoogleTransactionId(JNIEnv* env, jobject wallet);
40 // Establishes JNI bindings.
41 static bool RegisterAutofillDialogResult(JNIEnv* env);
43 private:
44 DISALLOW_COPY_AND_ASSIGN(AutofillDialogResult);
47 } // namespace autofill
49 #endif // CHROME_BROWSER_UI_ANDROID_AUTOFILL_AUTOFILL_DIALOG_RESULT_H_