Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 namespace experimental.identity { | 5 namespace experimental.identity { |
|
Matt Perry
2013/04/18 17:46:37
I hadn't seen this before, but we're trying to kil
Michael Courage
2013/04/18 19:52:24
The release of the Identity API has been blocked o
| |
| 6 | 6 |
| 7 [inline_doc] dictionary TokenDetails { | 7 [inline_doc] dictionary TokenDetails { |
| 8 // Whether to prompt the user to log in or grant scope permissions (if they | 8 // Whether to prompt the user to log in or grant scope permissions (if they |
| 9 // have not already done so). Default is false. | 9 // have not already done so). Default is false. |
| 10 boolean? interactive; | 10 boolean? interactive; |
| 11 }; | 11 }; |
| 12 | 12 |
| 13 [inline_doc] dictionary InvalidTokenDetails { | |
| 14 // The specific token that should be removed from the cache. | |
| 15 DOMString token; | |
| 16 }; | |
| 17 | |
| 13 [inline_doc] dictionary WebAuthFlowDetails { | 18 [inline_doc] dictionary WebAuthFlowDetails { |
| 14 // The URL that initiates the auth flow. | 19 // The URL that initiates the auth flow. |
| 15 DOMString url; | 20 DOMString url; |
| 16 | 21 |
| 17 // Whether to launch auth flow in interactive mode. Default is false. | 22 // Whether to launch auth flow in interactive mode. Default is false. |
| 18 boolean? interactive; | 23 boolean? interactive; |
| 19 | 24 |
| 20 // Width of the window, if one is shown in interactive mode. | 25 // Width of the window, if one is shown in interactive mode. |
| 21 long? width; | 26 long? width; |
| 22 | 27 |
| 23 // Height of the window, if one is shown in interactive mode. | 28 // Height of the window, if one is shown in interactive mode. |
| 24 long? height; | 29 long? height; |
| 25 | 30 |
| 26 // X coordinate of the window, if one is shown in interactive mode. | 31 // X coordinate of the window, if one is shown in interactive mode. |
| 27 long? left; | 32 long? left; |
| 28 | 33 |
| 29 // Y coordinate of the window, if one is shown in interactive mode. | 34 // Y coordinate of the window, if one is shown in interactive mode. |
| 30 long? top; | 35 long? top; |
| 31 }; | 36 }; |
| 32 | 37 |
| 33 callback GetAuthTokenCallback = void (optional DOMString token); | 38 callback GetAuthTokenCallback = void (optional DOMString token); |
| 39 callback InvalidateAuthTokenCallback = void (); | |
| 34 callback LaunchWebAuthFlowCallback = void (optional DOMString responseUrl); | 40 callback LaunchWebAuthFlowCallback = void (optional DOMString responseUrl); |
| 35 | 41 |
| 36 interface Functions { | 42 interface Functions { |
| 37 // Gets an OAuth2 access token as specified by the manifest. | 43 // Gets an OAuth2 access token as specified by the manifest. |
| 38 // | 44 // |
| 39 // |details| : Token options. | 45 // |details| : Token options. |
| 40 // |callback| : Called with an OAuth2 access token as specified by the | 46 // |callback| : Called with an OAuth2 access token as specified by the |
| 41 // manifest, or undefined if there was an error. | 47 // manifest, or undefined if there was an error. |
| 42 static void getAuthToken(optional TokenDetails details, | 48 static void getAuthToken(optional TokenDetails details, |
| 43 GetAuthTokenCallback callback); | 49 GetAuthTokenCallback callback); |
| 44 | 50 |
| 51 // Removes an OAuth2 access token from the token cache. | |
| 52 // | |
| 53 // |details| : Token information. | |
| 54 // |callback| : Called when the token has been removed from the cache. | |
| 55 static void invalidateAuthToken(InvalidTokenDetails details, | |
| 56 InvalidateAuthTokenCallback callback); | |
| 57 | |
| 45 // Starts an auth flow at the specified URL. | 58 // Starts an auth flow at the specified URL. |
| 46 // | 59 // |
| 47 // |details| : WebAuth flow options. | 60 // |details| : WebAuth flow options. |
| 48 // |callback| : Called with the URL redirected back to your application. | 61 // |callback| : Called with the URL redirected back to your application. |
| 49 static void launchWebAuthFlow(WebAuthFlowDetails details, | 62 static void launchWebAuthFlow(WebAuthFlowDetails details, |
| 50 LaunchWebAuthFlowCallback callback); | 63 LaunchWebAuthFlowCallback callback); |
| 51 }; | 64 }; |
| 52 }; | 65 }; |
| OLD | NEW |