blob: d62efef0f6aecf24c1bb83fc5a02f863bd77e522 [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
[email protected]e4b2fa32013-03-09 22:56:565#ifndef COMPONENTS_AUTOFILL_BROWSER_WALLET_REQUIRED_ACTION_H_
6#define COMPONENTS_AUTOFILL_BROWSER_WALLET_REQUIRED_ACTION_H_
[email protected]7a97aa82013-01-07 21:34:537
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.
[email protected]d75adab82013-03-09 00:24:1120 CHOOSE_ANOTHER_INSTRUMENT_OR_ADDRESS,
[email protected]7a97aa82013-01-07 21:34:5321 SETUP_WALLET,
22 ACCEPT_TOS,
23 GAIA_AUTH,
24 UPDATE_EXPIRATION_DATE,
25 UPGRADE_MIN_ADDRESS,
26 INVALID_FORM_FIELD,
[email protected]71a3a2ab2013-01-25 19:16:1527 VERIFY_CVV,
[email protected]ee2d56b2013-01-24 04:39:5128 PASSIVE_GAIA_AUTH,
[email protected]860c5212013-02-28 03:50:4829 REQUIRE_PHONE_NUMBER,
[email protected]7a97aa82013-01-07 21:34:5330};
31
[email protected]860c5212013-02-28 03:50:4832// Static helper functions to determine if an RequiredAction applies to a
33// FullWallet, WalletItems, or SaveToWallet response.
[email protected]7a97aa82013-01-07 21:34:5334bool ActionAppliesToFullWallet(RequiredAction action);
[email protected]860c5212013-02-28 03:50:4835bool ActionAppliesToSaveToWallet(RequiredAction action);
[email protected]7a97aa82013-01-07 21:34:5336bool ActionAppliesToWalletItems(RequiredAction action);
37
38// Turn a string value of the parsed JSON response into an RequiredAction.
39RequiredAction ParseRequiredActionFromString(const std::string& str);
40
41} // namespace wallet
[email protected]345175642013-02-20 19:25:5242} // namespace autofill
[email protected]7a97aa82013-01-07 21:34:5343
[email protected]e4b2fa32013-03-09 22:56:5644#endif // COMPONENTS_AUTOFILL_BROWSER_WALLET_REQUIRED_ACTION_H_