| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 namespace experimental.identity { |
| 6 |
| 7 [inline_doc] dictionary TokenDetails { |
| 8 // Whether to prompt the user to log in or grant scope permissions (if they |
| 9 // have not already done so). Default is false. |
| 10 boolean? interactive; |
| 11 }; |
| 12 |
| 13 [inline_doc] dictionary WebAuthFlowDetails { |
| 14 // The URL that initiates the auth flow. |
| 15 DOMString url; |
| 16 |
| 17 // Whether to launch auth flow in interactive mode. Default is false. |
| 18 boolean? interactive; |
| 19 |
| 20 // Width of the window, if one is shown in interactive mode. |
| 21 long? width; |
| 22 |
| 23 // Height of the window, if one is shown in interactive mode. |
| 24 long? height; |
| 25 |
| 26 // X coordinate of the window, if one is shown in interactive mode. |
| 27 long? left; |
| 28 |
| 29 // Y coordinate of the window, if one is shown in interactive mode. |
| 30 long? top; |
| 31 }; |
| 32 |
| 33 callback GetAuthTokenCallback = void (optional DOMString token); |
| 34 callback LaunchWebAuthFlowCallback = void (optional DOMString responseUrl); |
| 35 |
| 36 interface Functions { |
| 37 // Gets an OAuth2 access token as specified by the manifest. |
| 38 // |
| 39 // |details| : Token options. |
| 40 // |callback| : Called with an OAuth2 access token as specified by the |
| 41 // manifest, or undefined if there was an error. |
| 42 static void getAuthToken(optional TokenDetails details, |
| 43 GetAuthTokenCallback callback); |
| 44 |
| 45 // Starts an auth flow at the specified URL. |
| 46 // |
| 47 // |details| : WebAuth flow options. |
| 48 // |callback| : Called with the URL redirected back to your application. |
| 49 static void launchWebAuthFlow(WebAuthFlowDetails details, |
| 50 LaunchWebAuthFlowCallback callback); |
| 51 }; |
| 52 }; |
| OLD | NEW |