Index: chrome/browser/autofill/wallet/required_action.h |
diff --git a/chrome/browser/autofill/wallet/required_action.h b/chrome/browser/autofill/wallet/required_action.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e7e9242e3dcf6db5119eae0f3f527f42fea6a984 |
--- /dev/null |
+++ b/chrome/browser/autofill/wallet/required_action.h |
@@ -0,0 +1,35 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_AUTOFILL_WALLET_REQUIRED_ACTION_H_ |
+#define CHROME_BROWSER_AUTOFILL_WALLET_REQUIRED_ACTION_H_ |
+ |
+#include <string> |
+ |
+namespace wallet { |
+ |
+// Matches a subset of wallet proto values for required actions. Missing values |
+// are either deprecated or don't apply to Chrome's use of Online Wallet. |
+enum RequiredAction { |
+ UNKNOWN_TYPE = 0, // Catch all type, not in proto. |
+ SETUP_WALLET = 1, |
+ ACCEPT_TOS = 2, |
+ GAIA_AUTH = 4, |
+ UPDATE_EXPIRATION_DATE = 7, |
+ UPGRADE_MIN_ADDRESS = 8, |
+ INVALID_FORM_FIELD = 11, |
+ CVC_RISK_CHALLENGE = 12, |
ahutter
2013/01/07 17:50:11
Since we're only getting the string representation
Dan Beam
2013/01/07 18:29:08
Done.
|
+}; |
+ |
+// Static helper functions to determine if an RequiredAction applies to either a |
+// FullWallet or WalletItems. |
+bool ActionAppliesToFullWallet(RequiredAction action); |
+bool ActionAppliesToWalletItems(RequiredAction action); |
+ |
+// Turn a string value of the parsed JSON response into an RequiredAction. |
+RequiredAction ParseRequiredActionFromString(const std::string& str); |
+ |
+} // namespace wallet |
+ |
+#endif // CHROME_BROWSER_AUTOFILL_WALLET_REQUIRED_ACTION_H_ |