OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_ |
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 class AutofillClient { | 48 class AutofillClient { |
49 public: | 49 public: |
50 // Copy of blink::WebFormElement::AutocompleteResult. | 50 // Copy of blink::WebFormElement::AutocompleteResult. |
51 enum RequestAutocompleteResult { | 51 enum RequestAutocompleteResult { |
52 AutocompleteResultSuccess, | 52 AutocompleteResultSuccess, |
53 AutocompleteResultErrorDisabled, | 53 AutocompleteResultErrorDisabled, |
54 AutocompleteResultErrorCancel, | 54 AutocompleteResultErrorCancel, |
55 AutocompleteResultErrorInvalid, | 55 AutocompleteResultErrorInvalid, |
56 }; | 56 }; |
57 | 57 |
| 58 enum GetRealPanResult { |
| 59 // Request succeeded. |
| 60 SUCCESS, |
| 61 |
| 62 // Request failed; try again. |
| 63 TRY_AGAIN_FAILURE, |
| 64 |
| 65 // Request failed; don't try again. |
| 66 PERMANENT_FAILURE, |
| 67 |
| 68 // Unable to connect to Wallet servers. Prompt user to check internet |
| 69 // connection. |
| 70 NETWORK_ERROR, |
| 71 }; |
| 72 |
58 typedef base::Callback<void(RequestAutocompleteResult, | 73 typedef base::Callback<void(RequestAutocompleteResult, |
59 const base::string16&, | 74 const base::string16&, |
60 const FormStructure*)> ResultCallback; | 75 const FormStructure*)> ResultCallback; |
61 | 76 |
62 typedef base::Callback<void(const base::string16& /* card number */, | 77 typedef base::Callback<void(const base::string16& /* card number */, |
63 int /* exp month */, | 78 int /* exp month */, |
64 int /* exp year */)> CreditCardScanCallback; | 79 int /* exp year */)> CreditCardScanCallback; |
65 | 80 |
66 virtual ~AutofillClient() {} | 81 virtual ~AutofillClient() {} |
67 | 82 |
(...skipping 12 matching lines...) Expand all Loading... |
80 // Hides the associated request autocomplete dialog (if it exists). | 95 // Hides the associated request autocomplete dialog (if it exists). |
81 virtual void HideRequestAutocompleteDialog() = 0; | 96 virtual void HideRequestAutocompleteDialog() = 0; |
82 | 97 |
83 // Causes the Autofill settings UI to be shown. | 98 // Causes the Autofill settings UI to be shown. |
84 virtual void ShowAutofillSettings() = 0; | 99 virtual void ShowAutofillSettings() = 0; |
85 | 100 |
86 // A user has attempted to use a masked card. Prompt them for further | 101 // A user has attempted to use a masked card. Prompt them for further |
87 // information to proceed. | 102 // information to proceed. |
88 virtual void ShowUnmaskPrompt(const CreditCard& card, | 103 virtual void ShowUnmaskPrompt(const CreditCard& card, |
89 base::WeakPtr<CardUnmaskDelegate> delegate) = 0; | 104 base::WeakPtr<CardUnmaskDelegate> delegate) = 0; |
90 virtual void OnUnmaskVerificationResult(bool success) = 0; | 105 virtual void OnUnmaskVerificationResult(GetRealPanResult result) = 0; |
91 | 106 |
92 // Run |save_card_callback| if the credit card should be imported as personal | 107 // Run |save_card_callback| if the credit card should be imported as personal |
93 // data. |metric_logger| can be used to log user actions. | 108 // data. |metric_logger| can be used to log user actions. |
94 virtual void ConfirmSaveCreditCard( | 109 virtual void ConfirmSaveCreditCard( |
95 const base::Closure& save_card_callback) = 0; | 110 const base::Closure& save_card_callback) = 0; |
96 | 111 |
97 // Returns true if both the platform and the device support scanning credit | 112 // Returns true if both the platform and the device support scanning credit |
98 // cards. Should be called before ScanCreditCard(). | 113 // cards. Should be called before ScanCreditCard(). |
99 virtual bool HasCreditCardScanFeature() = 0; | 114 virtual bool HasCreditCardScanFeature() = 0; |
100 | 115 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 virtual void OnFirstUserGestureObserved() = 0; | 159 virtual void OnFirstUserGestureObserved() = 0; |
145 | 160 |
146 // Opens |url| with the supplied |disposition|. | 161 // Opens |url| with the supplied |disposition|. |
147 virtual void LinkClicked(const GURL& url, | 162 virtual void LinkClicked(const GURL& url, |
148 WindowOpenDisposition disposition) = 0; | 163 WindowOpenDisposition disposition) = 0; |
149 }; | 164 }; |
150 | 165 |
151 } // namespace autofill | 166 } // namespace autofill |
152 | 167 |
153 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_ | 168 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLIENT_H_ |
OLD | NEW |