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
3 // found in the LICENSE file.
5 // Simplified implementation of the <code>chrome.identity</code> for app_shell.
8 dictionary GetAuthTokenDetails
{
9 // Ignored parameter. Exists only for compatibility.
13 dictionary InvalidTokenDetails
{
14 // Ignored parameter. Exists only for compatibility.
18 // Called with the OAuth2 access token on success or undefined on error.
19 callback GetAuthTokenCallback
= void (optional DOMString token
);
21 // Called by removeCachedAuthToken().
22 callback InvalidateAuthTokenCallback
= void ();
25 // Returns an OAuth2 access token for the current app_shell user for scopes
26 // from the manifest. Does not prompt the user.
27 static
void getAuthToken
(GetAuthTokenDetails options
,
28 GetAuthTokenCallback
callback);
30 // Stub. Calls callback immediately because app_shell does not cache access
31 // tokens the way Chrome does.
32 static
void removeCachedAuthToken
(InvalidTokenDetails details
,
33 InvalidateAuthTokenCallback
callback);
37 // Stub. Never fired because app_shell only supports a single user account.
38 static
void onSignInChanged
(object account
, boolean signedIn
);