Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(793)

Side by Side Diff: remoting/android/java/src/org/chromium/chromoting/Desktop.java

Issue 135353002: Add Disconnect menu-item to Android Chromoting client (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | remoting/resources/menu/desktop_actionbar.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.res.Configuration; 8 import android.content.res.Configuration;
9 import android.os.Bundle; 9 import android.os.Bundle;
10 import android.view.KeyEvent; 10 import android.view.KeyEvent;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 /** Called whenever an action bar button is pressed. */ 53 /** Called whenever an action bar button is pressed. */
54 @Override 54 @Override
55 public boolean onOptionsItemSelected(MenuItem item) { 55 public boolean onOptionsItemSelected(MenuItem item) {
56 switch (item.getItemId()) { 56 switch (item.getItemId()) {
57 case R.id.actionbar_keyboard: 57 case R.id.actionbar_keyboard:
58 ((InputMethodManager)getSystemService(INPUT_METHOD_SERVICE)).tog gleSoftInput(0, 0); 58 ((InputMethodManager)getSystemService(INPUT_METHOD_SERVICE)).tog gleSoftInput(0, 0);
59 return true; 59 return true;
60 case R.id.actionbar_hide: 60 case R.id.actionbar_hide:
61 getActionBar().hide(); 61 getActionBar().hide();
62 return true; 62 return true;
63 case R.id.actionbar_disconnect:
64 JniInterface.disconnectFromHost();
65 return true;
63 default: 66 default:
64 return super.onOptionsItemSelected(item); 67 return super.onOptionsItemSelected(item);
65 } 68 }
66 } 69 }
67 70
68 /** 71 /**
69 * Called once when a keyboard key is pressed, then again when that same key is released. This 72 * Called once when a keyboard key is pressed, then again when that same key is released. This
70 * is not guaranteed to be notified of all soft keyboard events: certian key boards might not 73 * is not guaranteed to be notified of all soft keyboard events: certian key boards might not
71 * call it at all, while others might skip it in certain situations (e.g. sw ipe input). 74 * call it at all, while others might skip it in certain situations (e.g. sw ipe input).
72 */ 75 */
(...skipping 19 matching lines...) Expand all
92 JniInterface.keyboardAction(KeyEvent.KEYCODE_EQUALS, depressed); 95 JniInterface.keyboardAction(KeyEvent.KEYCODE_EQUALS, depressed);
93 break; 96 break;
94 default: 97 default:
95 // We try to send all other key codes to the host directly. 98 // We try to send all other key codes to the host directly.
96 JniInterface.keyboardAction(event.getKeyCode(), depressed); 99 JniInterface.keyboardAction(event.getKeyCode(), depressed);
97 } 100 }
98 101
99 return super.dispatchKeyEvent(event); 102 return super.dispatchKeyEvent(event);
100 } 103 }
101 } 104 }
OLDNEW
« no previous file with comments | « no previous file | remoting/resources/menu/desktop_actionbar.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698