| 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.jni; | 5 package org.chromium.chromoting.jni; |
| 6 | 6 |
| 7 import android.app.Activity; | 7 import android.app.Activity; |
| 8 import android.app.AlertDialog; | 8 import android.app.AlertDialog; |
| 9 import android.content.Context; | 9 import android.content.Context; |
| 10 import android.content.DialogInterface; | 10 import android.content.DialogInterface; |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 * is true. | 311 * is true. |
| 312 */ | 312 */ |
| 313 private static native void nativeAuthenticationResponse(String pin, boolean
createPair, | 313 private static native void nativeAuthenticationResponse(String pin, boolean
createPair, |
| 314 String deviceName); | 314 String deviceName); |
| 315 | 315 |
| 316 /** Saves newly-received pairing credentials to permanent storage. Called on
the UI thread. */ | 316 /** Saves newly-received pairing credentials to permanent storage. Called on
the UI thread. */ |
| 317 @CalledByNative | 317 @CalledByNative |
| 318 private static void commitPairingCredentials(String host, String id, String
secret) { | 318 private static void commitPairingCredentials(String host, String id, String
secret) { |
| 319 // Empty |id| indicates that pairing needs to be removed. | 319 // Empty |id| indicates that pairing needs to be removed. |
| 320 if (id.isEmpty()) { | 320 if (id.isEmpty()) { |
| 321 sContext.getPreferences(Activity.MODE_PRIVATE).edit(). | 321 sContext.getPreferences(Activity.MODE_PRIVATE).edit() |
| 322 remove(host + "_id"). | 322 .remove(host + "_id") |
| 323 remove(host + "_secret"). | 323 .remove(host + "_secret") |
| 324 apply(); | 324 .apply(); |
| 325 } else { | 325 } else { |
| 326 sContext.getPreferences(Activity.MODE_PRIVATE).edit(). | 326 sContext.getPreferences(Activity.MODE_PRIVATE).edit() |
| 327 putString(host + "_id", id). | 327 .putString(host + "_id", id) |
| 328 putString(host + "_secret", secret). | 328 .putString(host + "_secret", secret) |
| 329 apply(); | 329 .apply(); |
| 330 } | 330 } |
| 331 } | 331 } |
| 332 | 332 |
| 333 /** | 333 /** |
| 334 * Moves the mouse cursor, possibly while clicking the specified (nonnegativ
e) button. Called | 334 * Moves the mouse cursor, possibly while clicking the specified (nonnegativ
e) button. Called |
| 335 * on the UI thread. | 335 * on the UI thread. |
| 336 */ | 336 */ |
| 337 public static void sendMouseEvent(int x, int y, int whichButton, boolean but
tonDown) { | 337 public static void sendMouseEvent(int x, int y, int whichButton, boolean but
tonDown) { |
| 338 if (!sConnected) { | 338 if (!sConnected) { |
| 339 return; | 339 return; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 public static void sendExtensionMessage(String type, String data) { | 525 public static void sendExtensionMessage(String type, String data) { |
| 526 if (!sConnected) { | 526 if (!sConnected) { |
| 527 return; | 527 return; |
| 528 } | 528 } |
| 529 | 529 |
| 530 nativeSendExtensionMessage(type, data); | 530 nativeSendExtensionMessage(type, data); |
| 531 } | 531 } |
| 532 | 532 |
| 533 private static native void nativeSendExtensionMessage(String type, String da
ta); | 533 private static native void nativeSendExtensionMessage(String type, String da
ta); |
| 534 } | 534 } |
| OLD | NEW |