OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Simplified implementation of the <code>chrome.identity</code> for app_shell. | 5 // Simplified implementation of the <code>chrome.identity</code> for app_shell. |
6 namespace identity { | 6 namespace identity { |
7 | 7 |
8 dictionary GetAuthTokenDetails { | 8 dictionary GetAuthTokenDetails { |
9 // Ignored parameter. Exists only for compatibility. | 9 // Ignored parameter. Exists only for compatibility. |
10 boolean? interactive; | 10 boolean? interactive; |
11 }; | 11 }; |
12 | 12 |
| 13 dictionary InvalidTokenDetails { |
| 14 // Ignored parameter. Exists only for compatibility. |
| 15 DOMString? token; |
| 16 }; |
| 17 |
13 // Called with the OAuth2 access token on success or undefined on error. | 18 // Called with the OAuth2 access token on success or undefined on error. |
14 callback GetAuthTokenCallback = void (optional DOMString token); | 19 callback GetAuthTokenCallback = void (optional DOMString token); |
| 20 |
| 21 // Called by removeCachedAuthToken(). |
| 22 callback InvalidateAuthTokenCallback = void (); |
15 | 23 |
16 interface Functions { | 24 interface Functions { |
17 // Returns an OAuth2 access token for the current app_shell user for scopes | 25 // Returns an OAuth2 access token for the current app_shell user for scopes |
18 // from the manifest. Does not prompt the user. | 26 // from the manifest. Does not prompt the user. |
19 static void getAuthToken(GetAuthTokenDetails options, | 27 static void getAuthToken(GetAuthTokenDetails options, |
20 GetAuthTokenCallback callback); | 28 GetAuthTokenCallback callback); |
| 29 |
| 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); |
21 }; | 34 }; |
22 | 35 |
| 36 interface Events { |
| 37 // Stub. Never fired because app_shell only supports a single user account. |
| 38 static void onSignInChanged(object account, boolean signedIn); |
| 39 }; |
23 }; | 40 }; |
OLD | NEW |