OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 package org.chromium.chromoting; | 5 package org.chromium.chromoting; |
6 | 6 |
7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.app.AlertDialog; | 8 import android.app.AlertDialog; |
9 import android.app.ProgressDialog; | 9 import android.app.ProgressDialog; |
10 import android.content.DialogInterface; | 10 import android.content.DialogInterface; |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 } | 294 } |
295 | 295 |
296 preferences.apply(); | 296 preferences.apply(); |
297 } | 297 } |
298 | 298 |
299 /** Called when the activity is finally finished. */ | 299 /** Called when the activity is finally finished. */ |
300 @Override | 300 @Override |
301 public void onDestroy() { | 301 public void onDestroy() { |
302 super.onDestroy(); | 302 super.onDestroy(); |
303 JniInterface.disconnectFromHost(); | 303 JniInterface.disconnectFromHost(); |
| 304 mAccountSwitcher.destroy(); |
304 } | 305 } |
305 | 306 |
306 /** Called when a child Activity exits and sends a result back to this Activ
ity. */ | 307 /** Called when a child Activity exits and sends a result back to this Activ
ity. */ |
307 @Override | 308 @Override |
308 public void onActivityResult(int requestCode, int resultCode, Intent data) { | 309 public void onActivityResult(int requestCode, int resultCode, Intent data) { |
| 310 mAccountSwitcher.onActivityResult(requestCode, resultCode, data); |
| 311 |
309 if (requestCode == OAuthTokenFetcher.REQUEST_CODE_RECOVER_FROM_OAUTH_ERR
OR) { | 312 if (requestCode == OAuthTokenFetcher.REQUEST_CODE_RECOVER_FROM_OAUTH_ERR
OR) { |
310 if (resultCode == RESULT_OK) { | 313 if (resultCode == RESULT_OK) { |
311 // User gave OAuth permission to this app (or recovered from any
OAuth failure), | 314 // User gave OAuth permission to this app (or recovered from any
OAuth failure), |
312 // so retry fetching the token. | 315 // so retry fetching the token. |
313 requestAuthToken(false); | 316 requestAuthToken(false); |
314 } else { | 317 } else { |
315 // User denied permission or cancelled the dialog, so cancel the
request. | 318 // User denied permission or cancelled the dialog, so cancel the
request. |
316 mWaitingForAuthToken = false; | 319 mWaitingForAuthToken = false; |
317 setHostListProgressVisible(false); | 320 setHostListProgressVisible(false); |
318 } | 321 } |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 // Unreachable, but required by Google Java style and findbugs. | 557 // Unreachable, but required by Google Java style and findbugs. |
555 assert false : "Unreached"; | 558 assert false : "Unreached"; |
556 } | 559 } |
557 | 560 |
558 if (dismissProgress && mProgressIndicator != null) { | 561 if (dismissProgress && mProgressIndicator != null) { |
559 mProgressIndicator.dismiss(); | 562 mProgressIndicator.dismiss(); |
560 mProgressIndicator = null; | 563 mProgressIndicator = null; |
561 } | 564 } |
562 } | 565 } |
563 } | 566 } |
OLD | NEW |