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

Unified Diff: chrome/common/extensions/api/identity.idl

Issue 327403003: Identity API: add chrome.identity.getProfileUserInfo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add identity.email permission to stubs_app 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/common/extensions/api/identity.idl
diff --git a/chrome/common/extensions/api/identity.idl b/chrome/common/extensions/api/identity.idl
index b4bbe93a585b18810350639291ae8870940b64c7..31812eb803f1cb5f3243c22acc24920baa045588 100644
--- a/chrome/common/extensions/api/identity.idl
+++ b/chrome/common/extensions/api/identity.idl
@@ -11,6 +11,17 @@ namespace identity {
DOMString id;
};
+ dictionary ProfileUserInfo {
+ // An email address for the user account signed into the current
+ // profile. Empty if the user is not signed in.
+ DOMString email;
+
+ // A unique identifier for the account. This ID will not change
+ // for the lifetime of the account. Empty if the user is not
+ // signed in.
+ DOMString id;
+ };
+
dictionary TokenDetails {
// Fetching a token may require the user to sign-in to Chrome, or
// approve the application's requested scopes. If the interactive
@@ -54,6 +65,7 @@ namespace identity {
callback GetAuthTokenCallback = void (optional DOMString token);
callback GetAccountsCallback = void (AccountInfo[] accounts);
+ callback GetProfileUserInfoCallback = void (ProfileUserInfo userInfo);
callback InvalidateAuthTokenCallback = void ();
callback LaunchWebAuthFlowCallback = void (optional DOMString responseUrl);
@@ -85,6 +97,14 @@ namespace identity {
static void getAuthToken(optional TokenDetails details,
GetAuthTokenCallback callback);
+ // Retrieves email address and obfuscated gaia id of the user
+ // signed into a profile.
+ //
+ // This API is different from identity.getAccounts in two
+ // ways. The information returned is available offline, and it
+ // only applies to the primary account for the profile.
+ static void getProfileUserInfo(GetProfileUserInfoCallback callback);
+
// Removes an OAuth2 access token from the Identity API's token cache.
//
// If an access token is discovered to be invalid, it should be
« no previous file with comments | « chrome/common/extensions/api/_api_features.json ('k') | chrome/test/data/extensions/api_test/stubs_app/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698