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

Unified Diff: Src/GoogleApis.Auth.WP/OAuth2/WebAuthenticationBrokerUserControl.xaml.cs

Issue 117500043: Issue 475: Fix a bug when perssing on back button (Closed) Base URL: https://google-api-dotnet-client.googlecode.com/hg/
Patch Set: ContinueWith Created 9 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Src/GoogleApis.Auth.WP/OAuth2/WebAuthenticationBrokerUserControl.xaml.cs
===================================================================
--- a/Src/GoogleApis.Auth.WP/OAuth2/WebAuthenticationBrokerUserControl.xaml.cs
b/Src/GoogleApis.Auth.WP/OAuth2/WebAuthenticationBrokerUserControl.xaml.cs
@@ -96,6 96,10 @@
public Task<AuthorizationCodeResponseUrl> Launch(Uri uri)
{
tcsAuthorizationCodeResponse = new TaskCompletionSource<AuthorizationCodeResponseUrl>();
tcsAuthorizationCodeResponse.Task.ContinueWith(t =>
{
RemoveBackKeyPressCallback();
}, TaskScheduler.FromCurrentSynchronizationContext());
StartLoading();
browser.Navigate(uri);
return tcsAuthorizationCodeResponse.Task;
@@ -104,13 108,16 @@
/// <summary>A callback handler for when the user presses the back key.</summary>
void RootPage_BackKeyPress(object sender, System.ComponentModel.CancelEventArgs e)
{
- // Remove this callback.
e.Cancel = true;
tcsAuthorizationCodeResponse.SetCanceled();
}
/// <summary>Removes <see cref="RootPage_BackKeyPress" as the root page callback./></summary>
void RemoveBackKeyPressCallback()
{
PhoneApplicationFrame rootFrame = Application.Current.RootVisual as PhoneApplicationFrame;
PhoneApplicationPage rootPage = rootFrame.Content as PhoneApplicationPage;
rootPage.BackKeyPress -= RootPage_BackKeyPress;
-
- e.Cancel = true;
- tcsAuthorizationCodeResponse.SetCanceled();
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

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