| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 CHROME_BROWSER_AUTOFILL_WALLET_REQUIRED_ACTION_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_WALLET_REQUIRED_ACTION_H_ |
| 6 #define CHROME_BROWSER_AUTOFILL_WALLET_REQUIRED_ACTION_H_ | 6 #define CHROME_BROWSER_AUTOFILL_WALLET_REQUIRED_ACTION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 namespace wallet { | 10 namespace wallet { |
| 11 | 11 |
| 12 // Required actions are steps that must be taken before the current transaction | 12 // Required actions are steps that must be taken before the current transaction |
| 13 // can proceed. Examples of this is include accepting the Terms of Service to | 13 // can proceed. Examples of this is include accepting the Terms of Service to |
| 14 // use Google Wallet (happens on first use or when the ToS are updated) or | 14 // use Google Wallet (happens on first use or when the ToS are updated) or |
| 15 // typing a CVC when it's necessary verify the current user has access to the | 15 // typing a CVC when it's necessary verify the current user has access to the |
| 16 // backing card. | 16 // backing card. |
| 17 enum RequiredAction { | 17 enum RequiredAction { |
| 18 UNKNOWN_TYPE = 0, // Catch all type. | 18 UNKNOWN_TYPE = 0, // Catch all type. |
| 19 SETUP_WALLET, | 19 SETUP_WALLET, |
| 20 ACCEPT_TOS, | 20 ACCEPT_TOS, |
| 21 GAIA_AUTH, | 21 GAIA_AUTH, |
| 22 UPDATE_EXPIRATION_DATE, | 22 UPDATE_EXPIRATION_DATE, |
| 23 UPGRADE_MIN_ADDRESS, | 23 UPGRADE_MIN_ADDRESS, |
| 24 INVALID_FORM_FIELD, | 24 INVALID_FORM_FIELD, |
| 25 CVC_RISK_CHALLENGE, | 25 CVC_RISK_CHALLENGE, |
| 26 PASSIVE_GAIA_AUTH, |
| 26 }; | 27 }; |
| 27 | 28 |
| 28 // Static helper functions to determine if an RequiredAction applies to either a | 29 // Static helper functions to determine if an RequiredAction applies to either a |
| 29 // FullWallet or WalletItems. | 30 // FullWallet or WalletItems. |
| 30 bool ActionAppliesToFullWallet(RequiredAction action); | 31 bool ActionAppliesToFullWallet(RequiredAction action); |
| 31 bool ActionAppliesToWalletItems(RequiredAction action); | 32 bool ActionAppliesToWalletItems(RequiredAction action); |
| 32 | 33 |
| 33 // Turn a string value of the parsed JSON response into an RequiredAction. | 34 // Turn a string value of the parsed JSON response into an RequiredAction. |
| 34 RequiredAction ParseRequiredActionFromString(const std::string& str); | 35 RequiredAction ParseRequiredActionFromString(const std::string& str); |
| 35 | 36 |
| 36 } // namespace wallet | 37 } // namespace wallet |
| 37 | 38 |
| 38 #endif // CHROME_BROWSER_AUTOFILL_WALLET_REQUIRED_ACTION_H_ | 39 #endif // CHROME_BROWSER_AUTOFILL_WALLET_REQUIRED_ACTION_H_ |
| OLD | NEW |