LEFT | RIGHT |
(no file at all) | |
1 /* | 1 /* |
2 Copyright 2013 Google Inc | 2 Copyright 2013 Google Inc |
3 | 3 |
4 Licensed under the Apache License, Version 2.0 (the "License"); | 4 Licensed under the Apache License, Version 2.0 (the "License"); |
5 you may not use this file except in compliance with the License. | 5 you may not use this file except in compliance with the License. |
6 You may obtain a copy of the License at | 6 You may obtain a copy of the License at |
7 | 7 |
8 http://www.apache.org/licenses/LICENSE-2.0 | 8 http://www.apache.org/licenses/LICENSE-2.0 |
9 | 9 |
10 Unless required by applicable law or agreed to in writing, software | 10 Unless required by applicable law or agreed to in writing, software |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 tcsAuthorizationCodeResponse.SetResult(new AuthorizationCodeResp
onseUrl(query)); | 64 tcsAuthorizationCodeResponse.SetResult(new AuthorizationCodeResp
onseUrl(query)); |
65 } | 65 } |
66 } | 66 } |
67 | 67 |
68 /// <summary>Callback of browser navigation failed.</summary> | 68 /// <summary>Callback of browser navigation failed.</summary> |
69 private void OnBrowserNavigationFailed(object sender, NavigationFailedEv
entArgs e) | 69 private void OnBrowserNavigationFailed(object sender, NavigationFailedEv
entArgs e) |
70 { | 70 { |
71 if (!tcsAuthorizationCodeResponse.Task.IsCompleted) | 71 if (!tcsAuthorizationCodeResponse.Task.IsCompleted) |
72 { | 72 { |
73 // See https://code.google.com/p/google-api-dotnet-client/issues
/detail?id=431. | 73 // See https://code.google.com/p/google-api-dotnet-client/issues
/detail?id=431. |
74 // If we encounter a null exception, cancel the task because the
WP app crashed. | 74 // If we encounter a null exception, cancel the task because the
Windows Phone app crashed. |
75 if (e.Exception != null) | 75 if (e.Exception != null) |
76 { | 76 { |
77 tcsAuthorizationCodeResponse.SetException(e.Exception); | 77 tcsAuthorizationCodeResponse.SetException(e.Exception); |
78 } | 78 } |
79 else | 79 else |
80 { | 80 { |
81 tcsAuthorizationCodeResponse.SetCanceled(); | 81 tcsAuthorizationCodeResponse.SetCanceled(); |
82 } | 82 } |
83 } | 83 } |
84 } | 84 } |
(...skipping 28 matching lines...) Expand all Loading... |
113 | 113 |
114 if (!tcsAuthorizationCodeResponse.Task.IsCompleted && | 114 if (!tcsAuthorizationCodeResponse.Task.IsCompleted && |
115 !tcsAuthorizationCodeResponse.Task.IsCanceled) | 115 !tcsAuthorizationCodeResponse.Task.IsCanceled) |
116 { | 116 { |
117 e.Cancel = true; | 117 e.Cancel = true; |
118 tcsAuthorizationCodeResponse.SetCanceled(); | 118 tcsAuthorizationCodeResponse.SetCanceled(); |
119 } | 119 } |
120 } | 120 } |
121 } | 121 } |
122 } | 122 } |
LEFT | RIGHT |