[email protected] | 7a97aa8 | 2013-01-07 21:34:53 | [diff] [blame] | 1 | // Copyright (c) 2012 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. |
| 4 | |
| 5 | #ifndef CHROME_BROWSER_AUTOFILL_WALLET_REQUIRED_ACTION_H_ |
| 6 | #define CHROME_BROWSER_AUTOFILL_WALLET_REQUIRED_ACTION_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
[email protected] | 34517564 | 2013-02-20 19:25:52 | [diff] [blame] | 10 | namespace autofill { |
[email protected] | 7a97aa8 | 2013-01-07 21:34:53 | [diff] [blame] | 11 | namespace wallet { |
| 12 | |
| 13 | // Required actions are steps that must be taken before the current transaction |
| 14 | // can proceed. Examples of this is include accepting the Terms of Service to |
| 15 | // use Google Wallet (happens on first use or when the ToS are updated) or |
| 16 | // typing a CVC when it's necessary verify the current user has access to the |
| 17 | // backing card. |
| 18 | enum RequiredAction { |
| 19 | UNKNOWN_TYPE = 0, // Catch all type. |
| 20 | SETUP_WALLET, |
| 21 | ACCEPT_TOS, |
| 22 | GAIA_AUTH, |
| 23 | UPDATE_EXPIRATION_DATE, |
| 24 | UPGRADE_MIN_ADDRESS, |
| 25 | INVALID_FORM_FIELD, |
[email protected] | 71a3a2ab | 2013-01-25 19:16:15 | [diff] [blame] | 26 | VERIFY_CVV, |
[email protected] | ee2d56b | 2013-01-24 04:39:51 | [diff] [blame] | 27 | PASSIVE_GAIA_AUTH, |
[email protected] | 860c521 | 2013-02-28 03:50:48 | [diff] [blame^] | 28 | REQUIRE_PHONE_NUMBER, |
[email protected] | 7a97aa8 | 2013-01-07 21:34:53 | [diff] [blame] | 29 | }; |
| 30 | |
[email protected] | 860c521 | 2013-02-28 03:50:48 | [diff] [blame^] | 31 | // Static helper functions to determine if an RequiredAction applies to a |
| 32 | // FullWallet, WalletItems, or SaveToWallet response. |
[email protected] | 7a97aa8 | 2013-01-07 21:34:53 | [diff] [blame] | 33 | bool ActionAppliesToFullWallet(RequiredAction action); |
[email protected] | 860c521 | 2013-02-28 03:50:48 | [diff] [blame^] | 34 | bool ActionAppliesToSaveToWallet(RequiredAction action); |
[email protected] | 7a97aa8 | 2013-01-07 21:34:53 | [diff] [blame] | 35 | bool ActionAppliesToWalletItems(RequiredAction action); |
| 36 | |
| 37 | // Turn a string value of the parsed JSON response into an RequiredAction. |
| 38 | RequiredAction ParseRequiredActionFromString(const std::string& str); |
| 39 | |
| 40 | } // namespace wallet |
[email protected] | 34517564 | 2013-02-20 19:25:52 | [diff] [blame] | 41 | } // namespace autofill |
[email protected] | 7a97aa8 | 2013-01-07 21:34:53 | [diff] [blame] | 42 | |
| 43 | #endif // CHROME_BROWSER_AUTOFILL_WALLET_REQUIRED_ACTION_H_ |