Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: remoting/android/java/src/org/chromium/chromoting/Chromoting.java

Issue 1369903002: Android Chromoting: Add hooks for the official account-switcher (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add hooks for Google Play Services connection errors. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | remoting/android/java/src/org/chromium/chromoting/accountswitcher/AccountSwitcher.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | remoting/android/java/src/org/chromium/chromoting/accountswitcher/AccountSwitcher.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698