[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 | |
[email protected] | e4b2fa3 | 2013-03-09 22:56:56 | [diff] [blame] | 5 | #ifndef COMPONENTS_AUTOFILL_BROWSER_WALLET_REQUIRED_ACTION_H_ |
| 6 | #define COMPONENTS_AUTOFILL_BROWSER_WALLET_REQUIRED_ACTION_H_ |
[email protected] | 7a97aa8 | 2013-01-07 21:34:53 | [diff] [blame] | 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. |
[email protected] | d75adab8 | 2013-03-09 00:24:11 | [diff] [blame] | 20 | CHOOSE_ANOTHER_INSTRUMENT_OR_ADDRESS, |
[email protected] | 7a97aa8 | 2013-01-07 21:34:53 | [diff] [blame] | 21 | SETUP_WALLET, |
| 22 | ACCEPT_TOS, |
| 23 | GAIA_AUTH, |
| 24 | UPDATE_EXPIRATION_DATE, |
| 25 | UPGRADE_MIN_ADDRESS, |
| 26 | INVALID_FORM_FIELD, |
[email protected] | 71a3a2ab | 2013-01-25 19:16:15 | [diff] [blame] | 27 | VERIFY_CVV, |
[email protected] | ee2d56b | 2013-01-24 04:39:51 | [diff] [blame] | 28 | PASSIVE_GAIA_AUTH, |
[email protected] | 860c521 | 2013-02-28 03:50:48 | [diff] [blame] | 29 | REQUIRE_PHONE_NUMBER, |
[email protected] | 7a97aa8 | 2013-01-07 21:34:53 | [diff] [blame] | 30 | }; |
| 31 | |
[email protected] | 860c521 | 2013-02-28 03:50:48 | [diff] [blame] | 32 | // Static helper functions to determine if an RequiredAction applies to a |
| 33 | // FullWallet, WalletItems, or SaveToWallet response. |
[email protected] | 7a97aa8 | 2013-01-07 21:34:53 | [diff] [blame] | 34 | bool ActionAppliesToFullWallet(RequiredAction action); |
[email protected] | 860c521 | 2013-02-28 03:50:48 | [diff] [blame] | 35 | bool ActionAppliesToSaveToWallet(RequiredAction action); |
[email protected] | 7a97aa8 | 2013-01-07 21:34:53 | [diff] [blame] | 36 | bool ActionAppliesToWalletItems(RequiredAction action); |
| 37 | |
| 38 | // Turn a string value of the parsed JSON response into an RequiredAction. |
| 39 | RequiredAction ParseRequiredActionFromString(const std::string& str); |
| 40 | |
| 41 | } // namespace wallet |
[email protected] | 34517564 | 2013-02-20 19:25:52 | [diff] [blame] | 42 | } // namespace autofill |
[email protected] | 7a97aa8 | 2013-01-07 21:34:53 | [diff] [blame] | 43 | |
[email protected] | e4b2fa3 | 2013-03-09 22:56:56 | [diff] [blame] | 44 | #endif // COMPONENTS_AUTOFILL_BROWSER_WALLET_REQUIRED_ACTION_H_ |