Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_ | 5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_ |
| 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_ | 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 public: | 34 public: |
| 35 // Name of the preference property that persists the account information | 35 // Name of the preference property that persists the account information |
| 36 // tracked by this service. | 36 // tracked by this service. |
| 37 static const char kAccountInfoPref[]; | 37 static const char kAccountInfoPref[]; |
| 38 | 38 |
| 39 // TODO(mlerman): Remove all references to Profile::kNoHostedDomainFound in | 39 // TODO(mlerman): Remove all references to Profile::kNoHostedDomainFound in |
| 40 // favour of this. | 40 // favour of this. |
| 41 // Value representing no hosted domain in the kProfileHostedDomain preference. | 41 // Value representing no hosted domain in the kProfileHostedDomain preference. |
| 42 static const char kNoHostedDomainFound[]; | 42 static const char kNoHostedDomainFound[]; |
| 43 | 43 |
| 44 // Value representing no picture URL associated with and account. | |
|
Mike Lerman
2015/04/30 19:09:07
nit: s/and/an/
anthonyvd
2015/05/01 19:16:34
Done.
| |
| 45 static const char kNoPictureURLFound[]; | |
| 46 | |
| 44 // Information about a specific account. | 47 // Information about a specific account. |
| 45 struct AccountInfo { | 48 struct AccountInfo { |
| 46 AccountInfo(); | 49 AccountInfo(); |
| 47 ~AccountInfo(); | 50 ~AccountInfo(); |
| 48 | 51 |
| 49 std::string account_id; // The account ID used by OAuth2TokenService. | 52 std::string account_id; // The account ID used by OAuth2TokenService. |
| 50 std::string gaia; | 53 std::string gaia; |
| 51 std::string email; | 54 std::string email; |
| 52 std::string full_name; | 55 std::string full_name; |
| 53 std::string given_name; | 56 std::string given_name; |
| 54 std::string hosted_domain; | 57 std::string hosted_domain; |
| 55 std::string locale; | 58 std::string locale; |
| 56 // TODO(rogerta): eventually this structure will include other information | 59 std::string picture_url; |
| 57 // about the account, like full name, profile picture URL, etc. | 60 // TODO(anthonyvd): Eventually this structure should contain the account |
| 61 // service flags. | |
| 58 | 62 |
| 59 bool IsValid(); | 63 bool IsValid() const; |
| 60 }; | 64 }; |
| 61 | 65 |
| 62 // Clients of AccountTrackerService can implement this interface and register | 66 // Clients of AccountTrackerService can implement this interface and register |
| 63 // with AddObserver() to learn about account information changes. | 67 // with AddObserver() to learn about account information changes. |
| 64 class Observer { | 68 class Observer { |
| 65 public: | 69 public: |
| 66 virtual ~Observer() {} | 70 virtual ~Observer() {} |
| 67 virtual void OnAccountUpdated(const AccountInfo& info) {} | 71 virtual void OnAccountUpdated(const AccountInfo& info) {} |
| 68 virtual void OnAccountUpdateFailed(const std::string& account_id) {} | 72 virtual void OnAccountUpdateFailed(const std::string& account_id) {} |
| 69 virtual void OnAccountRemoved(const AccountInfo& info) {} | 73 virtual void OnAccountRemoved(const AccountInfo& info) {} |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 176 std::list<std::string> pending_user_info_fetches_; | 180 std::list<std::string> pending_user_info_fetches_; |
| 177 | 181 |
| 178 // Holds references to refresh token annotation requests keyed by account_id. | 182 // Holds references to refresh token annotation requests keyed by account_id. |
| 179 base::ScopedPtrHashMap<std::string, RefreshTokenAnnotationRequest> | 183 base::ScopedPtrHashMap<std::string, RefreshTokenAnnotationRequest> |
| 180 refresh_token_annotation_requests_; | 184 refresh_token_annotation_requests_; |
| 181 | 185 |
| 182 DISALLOW_COPY_AND_ASSIGN(AccountTrackerService); | 186 DISALLOW_COPY_AND_ASSIGN(AccountTrackerService); |
| 183 }; | 187 }; |
| 184 | 188 |
| 185 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_ | 189 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_TRACKER_SERVICE_H_ |
| OLD | NEW |