Chromium Code Reviews| Index: chrome/browser/extensions/api/identity/account_tracker.cc |
| diff --git a/chrome/browser/extensions/api/identity/account_tracker.cc b/chrome/browser/extensions/api/identity/account_tracker.cc |
| index fd0834ddc5b04d97ab00f3afeddfad7d9c455928..2be7b43a69df1ea77fbc786a0d5abed89875430d 100644 |
| --- a/chrome/browser/extensions/api/identity/account_tracker.cc |
| +++ b/chrome/browser/extensions/api/identity/account_tracker.cc |
| @@ -247,6 +247,16 @@ std::string AccountTracker::GetAccountId() const { |
| return account_errors_.begin()->first; |
| } |
| +std::string AccountTracker::GetUsername() const { |
| + if (account_errors_.size() > 0) { |
|
Michael Courage
2014/05/15 17:18:54
Might be clearer to call id = GetAccountId() here
Roger Tawa OOO till Jul 10th
2014/05/15 18:24:09
Done.
|
| + std::map<std::string, AccountState>::const_iterator it = |
| + accounts_.find(account_errors_.begin()->first); |
| + if (it != accounts_.end()) |
| + return it->second.ids.email; |
| + } |
| + return std::string(); |
| +} |
| + |
| GoogleServiceAuthError AccountTracker::GetAuthStatus() const { |
| if (account_errors_.size() == 0) |
| return GoogleServiceAuthError::AuthErrorNone(); |