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

Unified Diff: chrome/browser/extensions/api/identity/account_tracker.cc

Issue 293063002: Multiple account support in chrome.identity.getAuthToken (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use full name of enable-new-profile-management Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
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 6afc9f97c9aacd384e0ce131226baae4cf58a376..a93f505034a040ea673be1debff96b0d005881c4 100644
--- a/chrome/browser/extensions/api/identity/account_tracker.cc
+++ b/chrome/browser/extensions/api/identity/account_tracker.cc
@@ -77,6 +77,20 @@ std::vector<AccountIds> AccountTracker::GetAccounts() const {
return accounts;
}
+std::string AccountTracker::FindAccountKeyByGaiaId(const std::string& gaia_id) {
+ for (std::map<std::string, AccountState>::const_iterator it =
+ accounts_.begin();
+ it != accounts_.end();
+ ++it) {
+ const AccountState& state = it->second;
+ if (state.ids.gaia == gaia_id) {
+ return state.ids.account_key;
+ }
+ }
+
+ return std::string();
+}
+
void AccountTracker::OnRefreshTokenAvailable(const std::string& account_id) {
// Ignore refresh tokens if there is no primary account ID at all.
if (signin_manager_account_id().empty())
« no previous file with comments | « chrome/browser/extensions/api/identity/account_tracker.h ('k') | chrome/browser/extensions/api/identity/gaia_web_auth_flow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698