| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 org.chromium.chromoting.jni.Client; | 7 import org.chromium.chromoting.jni.Client; |
| 8 import org.chromium.chromoting.jni.ConnectionListener; | 8 import org.chromium.chromoting.jni.ConnectionListener; |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // connection failure and reload the host list. | 60 // connection failure and reload the host list. |
| 61 reloadHostListAndConnect(); | 61 reloadHostListAndConnect(); |
| 62 return; | 62 return; |
| 63 } | 63 } |
| 64 | 64 |
| 65 doConnect(); | 65 doConnect(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 private void doConnect() { | 68 private void doConnect() { |
| 69 mClient.connectToHost(mAccountName, mAuthToken, mHost.jabberId, mHost.id
, | 69 mClient.connectToHost(mAccountName, mAuthToken, mHost.jabberId, mHost.id
, |
| 70 mHost.publicKey, mAuthenticator, mFlags, this); | 70 mHost.publicKey, mAuthenticator, mFlags, mHost.hostVersion, mHos
t.hostOs, |
| 71 mHost.hostOsVersion, this); |
| 71 } | 72 } |
| 72 | 73 |
| 73 private static boolean hostIncomplete(HostInfo host) { | 74 private static boolean hostIncomplete(HostInfo host) { |
| 74 return host.jabberId.isEmpty() || host.publicKey.isEmpty(); | 75 return host.jabberId.isEmpty() || host.publicKey.isEmpty(); |
| 75 } | 76 } |
| 76 | 77 |
| 77 private void reloadHostListAndConnect() { | 78 private void reloadHostListAndConnect() { |
| 78 mTriedReloadingHostList = true; | 79 mTriedReloadingHostList = true; |
| 79 mHostListManager.retrieveHostList(mAuthToken, this); | 80 mHostListManager.retrieveHostList(mAuthToken, this); |
| 80 } | 81 } |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // Connection failed and reloading the host list also failed, so report
the connection | 141 // Connection failed and reloading the host list also failed, so report
the connection |
| 141 // error. | 142 // error. |
| 142 mConnectionListener.onConnectionState(ConnectionListener.State.FAILED, | 143 mConnectionListener.onConnectionState(ConnectionListener.State.FAILED, |
| 143 ConnectionListener.Error.PEER_IS_OFFLINE); | 144 ConnectionListener.Error.PEER_IS_OFFLINE); |
| 144 | 145 |
| 145 // Notify the caller that the host list failed to load, so the UI is upd
ated accordingly. | 146 // Notify the caller that the host list failed to load, so the UI is upd
ated accordingly. |
| 146 // The currently-displayed host list is not likely to be valid any more. | 147 // The currently-displayed host list is not likely to be valid any more. |
| 147 mHostListCallback.onError(error); | 148 mHostListCallback.onError(error); |
| 148 } | 149 } |
| 149 } | 150 } |
| OLD | NEW |