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.app.Activity; | 7 import android.app.Activity; |
8 import android.content.Intent; | |
9 import android.content.res.Configuration; | 8 import android.content.res.Configuration; |
10 import android.net.Uri; | |
11 import android.os.Bundle; | 9 import android.os.Bundle; |
12 import android.view.KeyEvent; | 10 import android.view.KeyEvent; |
13 import android.view.Menu; | 11 import android.view.Menu; |
14 import android.view.MenuItem; | 12 import android.view.MenuItem; |
15 import android.view.View; | 13 import android.view.View; |
16 import android.view.inputmethod.InputMethodManager; | 14 import android.view.inputmethod.InputMethodManager; |
17 import android.widget.ImageButton; | 15 import android.widget.ImageButton; |
18 | 16 |
19 import org.chromium.chromoting.jni.JniInterface; | 17 import org.chromium.chromoting.jni.JniInterface; |
20 | 18 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 for (int key : keys) { | 105 for (int key : keys) { |
108 JniInterface.keyboardAction(key, true); | 106 JniInterface.keyboardAction(key, true); |
109 } | 107 } |
110 for (int key : keys) { | 108 for (int key : keys) { |
111 JniInterface.keyboardAction(key, false); | 109 JniInterface.keyboardAction(key, false); |
112 } | 110 } |
113 } | 111 } |
114 return true; | 112 return true; |
115 | 113 |
116 case R.id.actionbar_help: | 114 case R.id.actionbar_help: |
117 { | 115 HelpActivity.launch(this, HELP_URL); |
118 Intent intent = new Intent(this, HelpActivity.class); | |
119 intent.setData(Uri.parse(HELP_URL)); | |
120 startActivity(intent); | |
121 } | |
122 return true; | 116 return true; |
123 | 117 |
124 default: | 118 default: |
125 return super.onOptionsItemSelected(item); | 119 return super.onOptionsItemSelected(item); |
126 } | 120 } |
127 } | 121 } |
128 | 122 |
129 /** | 123 /** |
130 * Called once when a keyboard key is pressed, then again when that same key
is released. This | 124 * Called once when a keyboard key is pressed, then again when that same key
is released. This |
131 * is not guaranteed to be notified of all soft keyboard events: certian key
boards might not | 125 * is not guaranteed to be notified of all soft keyboard events: certian key
boards might not |
(...skipping 25 matching lines...) Expand all Loading... |
157 break; | 151 break; |
158 | 152 |
159 default: | 153 default: |
160 // We try to send all other key codes to the host directly. | 154 // We try to send all other key codes to the host directly. |
161 JniInterface.keyboardAction(event.getKeyCode(), depressed); | 155 JniInterface.keyboardAction(event.getKeyCode(), depressed); |
162 } | 156 } |
163 | 157 |
164 return super.dispatchKeyEvent(event); | 158 return super.dispatchKeyEvent(event); |
165 } | 159 } |
166 } | 160 } |
OLD | NEW |