Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: chrome/browser/autofill/wallet/required_action.h

Issue 11777007: Adds wallet::RequiredAction for when we start interacting with Online Wallet. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment fix Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
5 #ifndef CHROME_BROWSER_AUTOFILL_WALLET_REQUIRED_ACTION_H_
6 #define CHROME_BROWSER_AUTOFILL_WALLET_REQUIRED_ACTION_H_
7
8 #include <string>
9
10 namespace wallet {
11
12 class RequiredAction {
13 public:
14 // Matches wallet proto values.
15 enum ActionType {
16 UNKNOWN_TYPE = 0, // Catch all type, not in proto.
17 SETUP_WALLET = 1,
18 ACCEPT_TOS = 2,
19 GAIA_AUTH = 4,
20 UPDATE_EXPIRATION_DATE = 7,
21 UPGRADE_MIN_ADDRESS = 8,
22 INVALID_FORM_FIELD = 11,
23 CVC_RISK_CHALLENGE = 12,
24 };
25
26 RequiredAction();
27 explicit RequiredAction(ActionType action_type);
28 virtual ~RequiredAction();
29
30 // Static helper functions to determine if an ActionType applies to either a
31 // FullWallet or WalletItems.
32 static bool AppliesToFullWallet(ActionType action_type);
33 static bool AppliesToWalletItems(ActionType action_type);
34
35 // Turn a string value of the parsed JSON response into an ActionType.
36 static ActionType ParseFromString(const std::string& str);
37
38 ActionType action_type() const { return action_type_; }
39 void set_action_type(ActionType action_type) { action_type_ = action_type; }
40
41 // Helper functions to determine if this RequiredAction instance applies to
42 // either a FullWallet or WalletItems.
43 bool AppliesToFullWallet() const;
44 bool AppliesToWalletItems() const;
45
46 // Whether |action_type_| is a known type.
47 bool IsKnownType() const;
48
49 // Whether this RequiredAction is equivalent to another.
50 bool operator==(const RequiredAction& action) const;
51
52 private:
53 ActionType action_type_;
54 // Type intentionally copyable.
55 };
56
57 } // namespace wallet
58
59 #endif // CHROME_BROWSER_AUTOFILL_WALLET_REQUIRED_ACTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698