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

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

Issue 19482019: Change Android client desktop panning and zooming behavior (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rescale/recenter after device rotation, clarify comments Created 7 years, 5 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 | « remoting/android/java/src/org/chromium/chromoting/DesktopView.java ('k') | no next file » | 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.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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 private static int sWidth = 0; 111 private static int sWidth = 0;
112 112
113 /** Screen height of the video feed. */ 113 /** Screen height of the video feed. */
114 private static int sHeight = 0; 114 private static int sHeight = 0;
115 115
116 /** Buffer holding the video feed. */ 116 /** Buffer holding the video feed. */
117 private static ByteBuffer sBuffer = null; 117 private static ByteBuffer sBuffer = null;
118 118
119 /** Reports whenever the connection status changes. */ 119 /** Reports whenever the connection status changes. */
120 private static void reportConnectionStatus(int state, int error) { 120 private static void reportConnectionStatus(int state, int error) {
121 if (state==SUCCESSFUL_CONNECTION) { 121 if (state == SUCCESSFUL_CONNECTION) {
122 sSuccessCallback.run(); 122 sSuccessCallback.run();
123 } 123 }
124 124
125 Toast.makeText(sContext, sContext.getResources().getStringArray( 125 Toast.makeText(sContext, sContext.getResources().getStringArray(
126 R.array.protoc_states)[state] + (error!=0 ? ": " + 126 R.array.protoc_states)[state] + (error != 0 ? ": " +
127 sContext.getResources().getStringArray(R.array.protoc_er rors)[error] : ""), 127 sContext.getResources().getStringArray(R.array.protoc_er rors)[error] : ""),
128 Toast.LENGTH_SHORT).show(); 128 Toast.LENGTH_SHORT).show();
129 } 129 }
130 130
131 /** Prompts the user to enter a PIN. */ 131 /** Prompts the user to enter a PIN. */
132 private static void displayAuthenticationPrompt() { 132 private static void displayAuthenticationPrompt() {
133 AlertDialog.Builder pinPrompt = new AlertDialog.Builder(sContext); 133 AlertDialog.Builder pinPrompt = new AlertDialog.Builder(sContext);
134 pinPrompt.setTitle(sContext.getString(R.string.pin_entry_title)); 134 pinPrompt.setTitle(sContext.getString(R.string.pin_entry_title));
135 pinPrompt.setMessage(sContext.getString(R.string.pin_entry_message)); 135 pinPrompt.setMessage(sContext.getString(R.string.pin_entry_message));
136 136
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 /** Performs the redrawing callback. */ 181 /** Performs the redrawing callback. */
182 private static void redrawGraphicsInternal() { 182 private static void redrawGraphicsInternal() {
183 sRedrawCallback.run(); 183 sRedrawCallback.run();
184 } 184 }
185 185
186 /** 186 /**
187 * Obtains the image buffer. 187 * Obtains the image buffer.
188 * This should not be called from the UI thread. (We prefer the native graph ics thread.) 188 * This should not be called from the UI thread. (We prefer the native graph ics thread.)
189 */ 189 */
190 public static Bitmap retrieveVideoFrame() { 190 public static Bitmap retrieveVideoFrame() {
191 if (Looper.myLooper()==Looper.getMainLooper()) { 191 if (Looper.myLooper() == Looper.getMainLooper()) {
192 Log.w("deskview", "Canvas being redrawn on UI thread"); 192 Log.w("deskview", "Canvas being redrawn on UI thread");
193 } 193 }
194 194
195 if (!sConnected) { 195 if (!sConnected) {
196 return null; 196 return null;
197 } 197 }
198 198
199 int[] frame = new int[sWidth * sHeight]; 199 int[] frame = new int[sWidth * sHeight];
200 200
201 sBuffer.order(ByteOrder.LITTLE_ENDIAN); 201 sBuffer.order(ByteOrder.LITTLE_ENDIAN);
202 sBuffer.asIntBuffer().get(frame, 0, frame.length); 202 sBuffer.asIntBuffer().get(frame, 0, frame.length);
203 203
204 return Bitmap.createBitmap(frame, 0, sWidth, sWidth, sHeight, Bitmap.Con fig.ARGB_8888); 204 return Bitmap.createBitmap(frame, 0, sWidth, sWidth, sHeight, Bitmap.Con fig.ARGB_8888);
205 } 205 }
206 206
207 /** Performs the native response to the user's PIN. */ 207 /** Performs the native response to the user's PIN. */
208 private static native void authenticationResponse(String pin); 208 private static native void authenticationResponse(String pin);
209 209
210 /** Schedules a redraw on the native graphics thread. */ 210 /** Schedules a redraw on the native graphics thread. */
211 private static native void scheduleRedrawNative(); 211 private static native void scheduleRedrawNative();
212 } 212 }
OLDNEW
« no previous file with comments | « remoting/android/java/src/org/chromium/chromoting/DesktopView.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698