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.content.Intent; | 8 import android.content.Intent; |
9 import android.content.pm.ApplicationInfo; | 9 import android.content.pm.ApplicationInfo; |
10 import android.content.pm.PackageManager; | 10 import android.content.pm.PackageManager; |
11 import android.content.pm.PackageManager.NameNotFoundException; | 11 import android.content.pm.PackageManager.NameNotFoundException; |
12 import android.os.Build; | 12 import android.os.Build; |
13 import android.os.Bundle; | 13 import android.os.Bundle; |
14 import android.support.v7.app.ActionBarActivity; | 14 import android.support.v7.app.AppCompatActivity; |
15 import android.view.KeyCharacterMap; | 15 import android.view.KeyCharacterMap; |
16 import android.view.KeyEvent; | 16 import android.view.KeyEvent; |
17 import android.view.Menu; | 17 import android.view.Menu; |
18 import android.view.MenuItem; | 18 import android.view.MenuItem; |
19 import android.view.View; | 19 import android.view.View; |
20 import android.view.inputmethod.InputMethodManager; | 20 import android.view.inputmethod.InputMethodManager; |
21 | 21 |
22 import org.chromium.chromoting.jni.JniInterface; | 22 import org.chromium.chromoting.jni.JniInterface; |
23 | 23 |
24 import java.util.Set; | 24 import java.util.Set; |
25 import java.util.TreeSet; | 25 import java.util.TreeSet; |
26 | 26 |
27 /** | 27 /** |
28 * A simple screen that does nothing except display a DesktopView and notify it
of rotations. | 28 * A simple screen that does nothing except display a DesktopView and notify it
of rotations. |
29 */ | 29 */ |
30 public class Desktop extends ActionBarActivity implements View.OnSystemUiVisibil
ityChangeListener { | 30 public class Desktop extends AppCompatActivity implements View.OnSystemUiVisibil
ityChangeListener { |
31 /** Web page to be displayed in the Help screen when launched from this acti
vity. */ | 31 /** Web page to be displayed in the Help screen when launched from this acti
vity. */ |
32 private static final String HELP_URL = | 32 private static final String HELP_URL = |
33 "https://support.google.com/chrome/?p=mobile_crd_connecthost"; | 33 "https://support.google.com/chrome/?p=mobile_crd_connecthost"; |
34 | 34 |
35 /** The surface that displays the remote host's desktop feed. */ | 35 /** The surface that displays the remote host's desktop feed. */ |
36 private DesktopView mRemoteHostDesktop; | 36 private DesktopView mRemoteHostDesktop; |
37 | 37 |
38 /** Set of pressed keys for which we've sent TextEvent. */ | 38 /** Set of pressed keys for which we've sent TextEvent. */ |
39 private Set<Integer> mPressedTextKeys = new TreeSet<Integer>(); | 39 private Set<Integer> mPressedTextKeys = new TreeSet<Integer>(); |
40 | 40 |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 JniInterface.sendKeyEvent(KeyEvent.KEYCODE_SHIFT_LEFT, pressed); | 309 JniInterface.sendKeyEvent(KeyEvent.KEYCODE_SHIFT_LEFT, pressed); |
310 JniInterface.sendKeyEvent(KeyEvent.KEYCODE_EQUALS, pressed); | 310 JniInterface.sendKeyEvent(KeyEvent.KEYCODE_EQUALS, pressed); |
311 return true; | 311 return true; |
312 | 312 |
313 default: | 313 default: |
314 // We try to send all other key codes to the host directly. | 314 // We try to send all other key codes to the host directly. |
315 return JniInterface.sendKeyEvent(keyCode, pressed); | 315 return JniInterface.sendKeyEvent(keyCode, pressed); |
316 } | 316 } |
317 } | 317 } |
318 } | 318 } |
OLD | NEW |