| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 // Use the <code>chrome.identity</code> API to get OAuth2 access tokens. | 5 // Use the <code>chrome.identity</code> API to get OAuth2 access tokens. |
| 6 namespace identity { | 6 namespace identity { |
| 7 | 7 |
| 8 dictionary AccountInfo { | 8 dictionary AccountInfo { |
| 9 // A unique identifier for the account. This ID will not change | 9 // A unique identifier for the account. This ID will not change |
| 10 // for the lifetime of the account. | 10 // for the lifetime of the account. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 callback GetAuthTokenCallback = void (optional DOMString token); | 72 callback GetAuthTokenCallback = void (optional DOMString token); |
| 73 callback GetAccountsCallback = void (AccountInfo[] accounts); | 73 callback GetAccountsCallback = void (AccountInfo[] accounts); |
| 74 callback GetProfileUserInfoCallback = void (ProfileUserInfo userInfo); | 74 callback GetProfileUserInfoCallback = void (ProfileUserInfo userInfo); |
| 75 callback InvalidateAuthTokenCallback = void (); | 75 callback InvalidateAuthTokenCallback = void (); |
| 76 callback LaunchWebAuthFlowCallback = void (optional DOMString responseUrl); | 76 callback LaunchWebAuthFlowCallback = void (optional DOMString responseUrl); |
| 77 | 77 |
| 78 interface Functions { | 78 interface Functions { |
| 79 // Retrieves a list of AccountInfo objects describing the accounts | 79 // Retrieves a list of AccountInfo objects describing the accounts |
| 80 // present on the profile.<br> | 80 // present on the profile. |
| 81 // |
| 81 // <code>getAccounts</code> is only supported on dev channel. | 82 // <code>getAccounts</code> is only supported on dev channel. |
| 82 static void getAccounts(GetAccountsCallback callback); | 83 static void getAccounts(GetAccountsCallback callback); |
| 83 | 84 |
| 84 // Gets an OAuth2 access token using the client ID and scopes | 85 // Gets an OAuth2 access token using the client ID and scopes |
| 85 // specified in the <a | 86 // specified in the <a |
| 86 // href="app_identity.html#update_manifest"><code>oauth2</code> | 87 // href="app_identity.html#update_manifest"><code>oauth2</code> |
| 87 // section of manifest.json</a>. | 88 // section of manifest.json</a>. |
| 88 // | 89 // |
| 89 // The Identity API caches access tokens in memory, so it's ok to | 90 // The Identity API caches access tokens in memory, so it's ok to |
| 90 // call <code>getAuthToken</code> non-interactively any time a token is | 91 // call <code>getAuthToken</code> non-interactively any time a token is |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 // | 152 // |
| 152 // |path| : The path appended to the end of the generated URL. | 153 // |path| : The path appended to the end of the generated URL. |
| 153 [nocompile] static DOMString getRedirectURL(optional DOMString path); | 154 [nocompile] static DOMString getRedirectURL(optional DOMString path); |
| 154 }; | 155 }; |
| 155 | 156 |
| 156 interface Events { | 157 interface Events { |
| 157 // Fired when signin state changes for an account on the user's profile. | 158 // Fired when signin state changes for an account on the user's profile. |
| 158 static void onSignInChanged(AccountInfo account, boolean signedIn); | 159 static void onSignInChanged(AccountInfo account, boolean signedIn); |
| 159 }; | 160 }; |
| 160 }; | 161 }; |
| OLD | NEW |