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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 ByteBuffer buffer) { | 460 ByteBuffer buffer) { |
461 sCursorHotspot = new Point(hotspotX, hotspotY); | 461 sCursorHotspot = new Point(hotspotX, hotspotY); |
462 | 462 |
463 int[] data = new int[width * height]; | 463 int[] data = new int[width * height]; |
464 buffer.order(ByteOrder.LITTLE_ENDIAN); | 464 buffer.order(ByteOrder.LITTLE_ENDIAN); |
465 buffer.asIntBuffer().get(data, 0, data.length); | 465 buffer.asIntBuffer().get(data, 0, data.length); |
466 sCursorBitmap = Bitmap.createBitmap(data, width, height, Bitmap.Config.A
RGB_8888); | 466 sCursorBitmap = Bitmap.createBitmap(data, width, height, Bitmap.Config.A
RGB_8888); |
467 } | 467 } |
468 | 468 |
469 /** Position of cursor hotspot within cursor image. Called on the graphics t
hread. */ | 469 /** Position of cursor hotspot within cursor image. Called on the graphics t
hread. */ |
470 public static Point getCursorHotspot() { return sCursorHotspot; } | 470 public static Point getCursorHotspot() { |
| 471 return sCursorHotspot; |
| 472 } |
471 | 473 |
472 /** Returns the current cursor shape. Called on the graphics thread. */ | 474 /** Returns the current cursor shape. Called on the graphics thread. */ |
473 public static Bitmap getCursorBitmap() { return sCursorBitmap; } | 475 public static Bitmap getCursorBitmap() { |
| 476 return sCursorBitmap; |
| 477 } |
474 | 478 |
475 // | 479 // |
476 // Third Party Authentication | 480 // Third Party Authentication |
477 // | 481 // |
478 | 482 |
479 /** Pops up a third party login page to fetch the token required for authent
ication. */ | 483 /** Pops up a third party login page to fetch the token required for authent
ication. */ |
480 @CalledByNative | 484 @CalledByNative |
481 public static void fetchThirdPartyToken(String tokenUrl, String clientId, St
ring scope) { | 485 public static void fetchThirdPartyToken(String tokenUrl, String clientId, St
ring scope) { |
482 Chromoting app = (Chromoting) sContext; | 486 Chromoting app = (Chromoting) sContext; |
483 app.fetchThirdPartyToken(tokenUrl, clientId, scope); | 487 app.fetchThirdPartyToken(tokenUrl, clientId, scope); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 public static void sendExtensionMessage(String type, String data) { | 525 public static void sendExtensionMessage(String type, String data) { |
522 if (!sConnected) { | 526 if (!sConnected) { |
523 return; | 527 return; |
524 } | 528 } |
525 | 529 |
526 nativeSendExtensionMessage(type, data); | 530 nativeSendExtensionMessage(type, data); |
527 } | 531 } |
528 | 532 |
529 private static native void nativeSendExtensionMessage(String type, String da
ta); | 533 private static native void nativeSendExtensionMessage(String type, String da
ta); |
530 } | 534 } |
OLD | NEW |