Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(465)

Unified Diff: Src/GoogleApis.Auth.WinRT/OAuth2/AuthorizationCodeWinRTInstalledApp.cs

Issue 94340043: Issue 463: Provide a signout\logout method (Closed) Base URL: https://google-api-dotnet-client.googlecode.com/hg/
Patch Set: Gus' comments Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Src/GoogleApis.Auth.WinRT/OAuth2/AuthorizationCodeWinRTInstalledApp.cs
===================================================================
--- a/Src/GoogleApis.Auth.WinRT/OAuth2/AuthorizationCodeWinRTInstalledApp.cs
+++ b/Src/GoogleApis.Auth.WinRT/OAuth2/AuthorizationCodeWinRTInstalledApp.cs
@@ -31,15 +31,25 @@
/// </summary>
public sealed class AuthorizationCodeWinRTInstalledApp : IAuthorizationCodeInstalledApp
{
- private IAuthorizationCodeInstalledApp innerInstallApp;
+ private readonly IAuthorizationCodeInstalledApp innerInstallApp;
- private readonly AuthorizationCodeFlow.Initializer authorizationCodeFlowInitializer;
-
- /// <summary>Constructs a new authorization code installed application for Windows Store.</summary>
- /// <param name="authorizationCodeFlowInitializer">A authorization code flow initializer</param>
+ /// <summary>
+ /// Constructs a new authorization code for Windows Store application targeting an installed application flow.
+ /// </summary>
+ /// <param name="authorizationCodeFlowInitializer">An authorization code flow initializer.</param>
public AuthorizationCodeWinRTInstalledApp(AuthorizationCodeFlow.Initializer authorizationCodeFlowInitializer)
{
- this.authorizationCodeFlowInitializer = authorizationCodeFlowInitializer;
+ innerInstallApp = new AuthorizationCodeInstalledApp(
+ new AuthorizationCodeFlow(authorizationCodeFlowInitializer), new AuthorizationCodeBroker());
+ }
+
+ /// <summary>
+ /// Constructs a new authorization code for Windows Store application targeting an installed application flow.
+ /// </summary>
+ /// <param name="flow">An authorization code flow.</param>
+ public AuthorizationCodeWinRTInstalledApp(IAuthorizationCodeFlow flow)
+ {
+ innerInstallApp = new AuthorizationCodeInstalledApp(flow, new AuthorizationCodeBroker());
}
#region IAuthorizationCodeInstalledApp Members
@@ -56,12 +66,6 @@
public async Task<UserCredential> AuthorizeAsync(string userId, CancellationToken taskCancellationToken)
{
- if (innerInstallApp == null)
- {
- innerInstallApp = new AuthorizationCodeInstalledApp(
- new AuthorizationCodeFlow(authorizationCodeFlowInitializer), new AuthorizationCodeBroker());
- }
-
return await innerInstallApp.AuthorizeAsync(userId, taskCancellationToken).ConfigureAwait(false);
}

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b