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