| 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.ProgressDialog; | 8 import android.app.ProgressDialog; |
| 9 import android.content.DialogInterface; | 9 import android.content.DialogInterface; |
| 10 import android.content.Intent; | 10 import android.content.Intent; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 import android.widget.Toast; | 31 import android.widget.Toast; |
| 32 | 32 |
| 33 import org.chromium.base.ApiCompatibilityUtils; | 33 import org.chromium.base.ApiCompatibilityUtils; |
| 34 import org.chromium.base.Log; | 34 import org.chromium.base.Log; |
| 35 import org.chromium.chromoting.accountswitcher.AccountSwitcher; | 35 import org.chromium.chromoting.accountswitcher.AccountSwitcher; |
| 36 import org.chromium.chromoting.accountswitcher.AccountSwitcherFactory; | 36 import org.chromium.chromoting.accountswitcher.AccountSwitcherFactory; |
| 37 import org.chromium.chromoting.help.HelpContext; | 37 import org.chromium.chromoting.help.HelpContext; |
| 38 import org.chromium.chromoting.help.HelpSingleton; | 38 import org.chromium.chromoting.help.HelpSingleton; |
| 39 import org.chromium.chromoting.jni.Client; | 39 import org.chromium.chromoting.jni.Client; |
| 40 import org.chromium.chromoting.jni.ConnectionListener; | 40 import org.chromium.chromoting.jni.ConnectionListener; |
| 41 import org.chromium.chromoting.jni.JniInterface; | |
| 42 | 41 |
| 43 import java.util.ArrayList; | 42 import java.util.ArrayList; |
| 44 import java.util.Arrays; | 43 import java.util.Arrays; |
| 45 | 44 |
| 46 /** | 45 /** |
| 47 * The user interface for querying and displaying a user's host list from the di
rectory server. It | 46 * The user interface for querying and displaying a user's host list from the di
rectory server. It |
| 48 * also requests and renews authentication tokens using the system account manag
er. | 47 * also requests and renews authentication tokens using the system account manag
er. |
| 49 */ | 48 */ |
| 50 public class Chromoting extends AppCompatActivity implements ConnectionListener, | 49 public class Chromoting extends AppCompatActivity implements ConnectionListener, |
| 51 AccountSwitcher.Callback, HostListLoader.Callback, View.OnClickListener
{ | 50 AccountSwitcher.Callback, HostListLoader.Callback, View.OnClickListener
{ |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 | 268 |
| 270 mAccountSwitcher = AccountSwitcherFactory.getInstance().createAccountSwi
tcher(this, this); | 269 mAccountSwitcher = AccountSwitcherFactory.getInstance().createAccountSwi
tcher(this, this); |
| 271 mAccountSwitcher.setNavigation(navigationMenu); | 270 mAccountSwitcher.setNavigation(navigationMenu); |
| 272 LinearLayout navigationDrawer = (LinearLayout) findViewById(R.id.navigat
ion_drawer); | 271 LinearLayout navigationDrawer = (LinearLayout) findViewById(R.id.navigat
ion_drawer); |
| 273 mAccountSwitcher.setDrawer(navigationDrawer); | 272 mAccountSwitcher.setDrawer(navigationDrawer); |
| 274 View switcherView = mAccountSwitcher.getView(); | 273 View switcherView = mAccountSwitcher.getView(); |
| 275 switcherView.setLayoutParams(new LinearLayout.LayoutParams( | 274 switcherView.setLayoutParams(new LinearLayout.LayoutParams( |
| 276 LinearLayout.LayoutParams.MATCH_PARENT, | 275 LinearLayout.LayoutParams.MATCH_PARENT, |
| 277 LinearLayout.LayoutParams.WRAP_CONTENT)); | 276 LinearLayout.LayoutParams.WRAP_CONTENT)); |
| 278 navigationDrawer.addView(switcherView, 0); | 277 navigationDrawer.addView(switcherView, 0); |
| 279 | |
| 280 // Bring native components online. | |
| 281 JniInterface.loadLibrary(this); | |
| 282 } | 278 } |
| 283 | 279 |
| 284 @Override | 280 @Override |
| 285 protected void onPostCreate(Bundle savedInstanceState) { | 281 protected void onPostCreate(Bundle savedInstanceState) { |
| 286 super.onPostCreate(savedInstanceState); | 282 super.onPostCreate(savedInstanceState); |
| 287 mDrawerToggle.syncState(); | 283 mDrawerToggle.syncState(); |
| 288 } | 284 } |
| 289 | 285 |
| 290 @Override | 286 @Override |
| 291 protected void onNewIntent(Intent intent) { | 287 protected void onNewIntent(Intent intent) { |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 // Unreachable, but required by Google Java style and findbugs. | 634 // Unreachable, but required by Google Java style and findbugs. |
| 639 assert false : "Unreached"; | 635 assert false : "Unreached"; |
| 640 } | 636 } |
| 641 | 637 |
| 642 if (dismissProgress && mProgressIndicator != null) { | 638 if (dismissProgress && mProgressIndicator != null) { |
| 643 mProgressIndicator.dismiss(); | 639 mProgressIndicator.dismiss(); |
| 644 mProgressIndicator = null; | 640 mProgressIndicator = null; |
| 645 } | 641 } |
| 646 } | 642 } |
| 647 } | 643 } |
| OLD | NEW |