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

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

Issue 274853002: Identity API: add chrome.identity.getAccounts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/identity/account_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/identity/account_tracker.h
diff --git a/chrome/browser/extensions/api/identity/account_tracker.h b/chrome/browser/extensions/api/identity/account_tracker.h
index 1ec914c05261a6b1a04e192ed0c3b1b0be2a2201..479b91e5e00f0853fb9932a6174bc674cb0f4c56 100644
--- a/chrome/browser/extensions/api/identity/account_tracker.h
+++ b/chrome/browser/extensions/api/identity/account_tracker.h
@@ -7,6 +7,7 @@
#include <map>
#include <string>
+#include <vector>
#include "base/observer_list.h"
#include "components/signin/core/browser/signin_error_controller.h"
@@ -59,6 +60,11 @@ class AccountTracker : public OAuth2TokenService::Observer,
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
+ // Returns the list of accounts that are signed in, and for which gaia IDs
+ // have been fetched. The primary account for the profile will be first
+ // in the vector. Additional accounts will be in order of their gaia IDs.
+ std::vector<AccountIds> GetAccounts() const;
+
// OAuth2TokenService::Observer implementation.
virtual void OnRefreshTokenAvailable(const std::string& account_key) OVERRIDE;
virtual void OnRefreshTokenRevoked(const std::string& account_key) OVERRIDE;
@@ -76,13 +82,16 @@ class AccountTracker : public OAuth2TokenService::Observer,
const std::string& password) OVERRIDE;
virtual void GoogleSignedOut(const std::string& username) OVERRIDE;
+ // Sets the state of an account. Does not fire notifications.
+ void SetAccountStateForTest(AccountIds ids, bool is_signed_in);
+
private:
struct AccountState {
AccountIds ids;
bool is_signed_in;
};
- const std::string signin_manager_account_id();
+ const std::string signin_manager_account_id() const;
void NotifyAccountAdded(const AccountState& account);
void NotifyAccountRemoved(const AccountState& account);
« no previous file with comments | « no previous file | chrome/browser/extensions/api/identity/account_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698