blob: 0136009a310e949a9a9648da487d991eb8fc641b [file] [log] [blame]
[email protected]7a97aa82013-01-07 21:34:531// 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]345175642013-02-20 19:25:5210namespace autofill {
[email protected]7a97aa82013-01-07 21:34:5311namespace 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.
18enum 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]71a3a2ab2013-01-25 19:16:1526 VERIFY_CVV,
[email protected]ee2d56b2013-01-24 04:39:5127 PASSIVE_GAIA_AUTH,
[email protected]860c5212013-02-28 03:50:4828 REQUIRE_PHONE_NUMBER,
[email protected]7a97aa82013-01-07 21:34:5329};
30
[email protected]860c5212013-02-28 03:50:4831// Static helper functions to determine if an RequiredAction applies to a
32// FullWallet, WalletItems, or SaveToWallet response.
[email protected]7a97aa82013-01-07 21:34:5333bool ActionAppliesToFullWallet(RequiredAction action);
[email protected]860c5212013-02-28 03:50:4834bool ActionAppliesToSaveToWallet(RequiredAction action);
[email protected]7a97aa82013-01-07 21:34:5335bool ActionAppliesToWalletItems(RequiredAction action);
36
37// Turn a string value of the parsed JSON response into an RequiredAction.
38RequiredAction ParseRequiredActionFromString(const std::string& str);
39
40} // namespace wallet
[email protected]345175642013-02-20 19:25:5241} // namespace autofill
[email protected]7a97aa82013-01-07 21:34:5342
43#endif // CHROME_BROWSER_AUTOFILL_WALLET_REQUIRED_ACTION_H_