summaryrefslogtreecommitdiffstats
path: root/components/autofill/content/browser/wallet/wallet_items.h
diff options
context:
space:
mode:
Diffstat (limited to 'components/autofill/content/browser/wallet/wallet_items.h')
-rw-r--r--components/autofill/content/browser/wallet/wallet_items.h39
1 files changed, 16 insertions, 23 deletions
diff --git a/components/autofill/content/browser/wallet/wallet_items.h b/components/autofill/content/browser/wallet/wallet_items.h
index eb3d526..3717088 100644
--- a/components/autofill/content/browser/wallet/wallet_items.h
+++ b/components/autofill/content/browser/wallet/wallet_items.h
@@ -36,6 +36,7 @@ FORWARD_DECLARE_TEST(WalletInstrumentWrapperTest,
namespace wallet {
+class GaiaAccount;
class WalletItemsTest;
enum AmexPermission {
@@ -219,16 +220,17 @@ class WalletItems {
bool operator==(const WalletItems& other) const;
bool operator!=(const WalletItems& other) const;
+ void AddAccount(scoped_ptr<GaiaAccount> account);
void AddInstrument(scoped_ptr<MaskedInstrument> instrument) {
- DCHECK(instrument.get());
+ DCHECK(instrument);
instruments_.push_back(instrument.release());
}
void AddAddress(scoped_ptr<Address> address) {
- DCHECK(address.get());
+ DCHECK(address);
addresses_.push_back(address.release());
}
void AddLegalDocument(scoped_ptr<LegalDocument> legal_document) {
- DCHECK(legal_document.get());
+ DCHECK(legal_document);
legal_documents_.push_back(legal_document.release());
}
@@ -244,6 +246,9 @@ class WalletItems {
bool SupportsCard(const base::string16& card_number,
base::string16* message) const;
+ const std::vector<GaiaAccount*>& gaia_accounts() const {
+ return gaia_accounts_.get();
+ }
const std::vector<RequiredAction>& required_actions() const {
return required_actions_;
}
@@ -258,11 +263,10 @@ class WalletItems {
}
const std::vector<Address*>& addresses() const { return addresses_.get(); }
const std::string& default_address_id() const { return default_address_id_; }
- const std::string& obfuscated_gaia_id() const { return obfuscated_gaia_id_; }
+ // Returns the GAIA id of the active account, or an empty string if no account
+ // is active.
+ std::string ObfuscatedGaiaId() const;
size_t active_account_index() const { return active_account_index_; }
- const std::vector<std::string>& gaia_accounts() const {
- return gaia_accounts_;
- }
const std::vector<LegalDocument*>& legal_documents() const {
return legal_documents_.get();
}
@@ -273,9 +277,7 @@ class WalletItems {
const std::vector<RequiredAction>&,
const std::string&,
const std::string&,
- AmexPermission,
- const std::vector<std::string>&,
- size_t);
+ AmexPermission);
friend scoped_ptr<WalletItems> GetTestWalletItemsWithDefaultIds(
RequiredAction action);
FRIEND_TEST_ALL_PREFIXES(WalletItemsTest, CreateWalletItems);
@@ -286,10 +288,7 @@ class WalletItems {
const std::string& google_transaction_id,
const std::string& default_instrument_id,
const std::string& default_address_id,
- const std::string& obfuscated_gaia_id,
- size_t active_account_index,
- AmexPermission amex_permission,
- const std::vector<std::string>& gaia_accounts);
+ AmexPermission amex_permission);
// Actions that must be completed by the user before a FullWallet can be
// issued to them by the Online Wallet service.
@@ -304,14 +303,13 @@ class WalletItems {
// The id of the user's default address.
std::string default_address_id_;
- // The externalized Gaia id of the user. TODO(estade): we can remove this
- // if |gaia_accounts_| is made to hold more metadata about the accounts.
- std::string obfuscated_gaia_id_;
-
// The index into |gaia_accounts_| of the account for which this object
// holds data.
size_t active_account_index_;
+ // The complete set of logged in GAIA accounts.
+ ScopedVector<GaiaAccount> gaia_accounts_;
+
// The user's backing instruments.
ScopedVector<MaskedInstrument> instruments_;
@@ -324,11 +322,6 @@ class WalletItems {
// Whether Google Wallet allows American Express card for this merchant.
AmexPermission amex_permission_;
- // The complete set of logged in GAIA accounts. This just stores email
- // addresses. The actual response has more metadata which we currently
- // ignore.
- std::vector<std::string> gaia_accounts_;
-
DISALLOW_COPY_AND_ASSIGN(WalletItems);
};