• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2013 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 COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_GAIA_ACCOUNTS_H_
6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_GAIA_ACCOUNTS_H_
7 
8 #include <string>
9 
10 #include "base/memory/scoped_ptr.h"
11 
12 namespace base {
13 class DictionaryValue;
14 }
15 
16 namespace autofill {
17 namespace wallet {
18 
19 class GaiaAccount {
20  public:
21   ~GaiaAccount();
22 
23   // Returns an empty scoped_ptr if input is invalid, otherwise a valid GAIA
24   // account.
25   static scoped_ptr<GaiaAccount> Create(
26       const base::DictionaryValue& dictionary);
27 
28   static scoped_ptr<GaiaAccount> CreateForTesting(
29       const std::string& email_address,
30       const std::string& obfuscated_id,
31       size_t index,
32       bool is_active);
33 
34   bool operator==(const GaiaAccount& other) const;
35   bool operator!=(const GaiaAccount& other) const;
36 
email_address()37   const std::string& email_address() const { return email_address_; }
obfuscated_id()38   const std::string& obfuscated_id() const { return obfuscated_id_; }
index()39   size_t index() const { return index_; }
is_active()40   bool is_active() const { return is_active_; }
41 
42  private:
43   GaiaAccount(const std::string& email_address,
44               const std::string& obfuscated_id,
45               size_t index,
46               bool is_active);
47 
48   std::string email_address_;
49   std::string obfuscated_id_;
50   size_t index_;
51   bool is_active_;
52 
53   DISALLOW_COPY_AND_ASSIGN(GaiaAccount);
54 };
55 
56 }  // namespace wallet
57 }  // namespace autofill
58 
59 #endif  // COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_GAIA_ACCOUNTS_H_
60