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

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

Issue 2096193002: Add functions to DesktopViewInterface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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.content.Context; 7 import android.content.Context;
8 import android.graphics.Matrix; 8 import android.graphics.Matrix;
9 import android.graphics.Point; 9 import android.graphics.Point;
10 import android.graphics.PointF; 10 import android.graphics.PointF;
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 new SimulatedTouchInputStrategy(mRenderData, injecto r, mContext)); 287 new SimulatedTouchInputStrategy(mRenderData, injecto r, mContext));
288 } 288 }
289 break; 289 break;
290 290
291 default: 291 default:
292 // Unreachable, but required by Google Java style and findbugs. 292 // Unreachable, but required by Google Java style and findbugs.
293 assert false : "Unreached"; 293 assert false : "Unreached";
294 } 294 }
295 295
296 // Ensure the cursor state is updated appropriately. 296 // Ensure the cursor state is updated appropriately.
297 // TODO (zijiehe): Move repaint control out of DesktopView. 297 mViewer.cursorVisibilityChanged();
298 if (mViewer instanceof DesktopView) {
299 ((DesktopView) mViewer).requestRepaint();
300 }
301 } 298 }
302 299
303 private void handleSoftInputMethodVisibilityChanged( 300 private void handleSoftInputMethodVisibilityChanged(
304 SoftInputMethodVisibilityChangedEventParameter parameter) { 301 SoftInputMethodVisibilityChangedEventParameter parameter) {
305 synchronized (mRenderData) { 302 synchronized (mRenderData) {
306 if (parameter.visible) { 303 if (parameter.visible) {
307 mDesktopCanvas.setInputMethodOffsetValues( 304 mDesktopCanvas.setInputMethodOffsetValues(
308 mRenderData.screenWidth - parameter.right, 305 mRenderData.screenWidth - parameter.right,
309 mRenderData.screenHeight - parameter.bottom); 306 mRenderData.screenHeight - parameter.bottom);
310 } else { 307 } else {
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 } 447 }
451 448
452 /** Moves the cursor to the specified position on the remote host. */ 449 /** Moves the cursor to the specified position on the remote host. */
453 private void moveCursor(int newX, int newY) { 450 private void moveCursor(int newX, int newY) {
454 synchronized (mRenderData) { 451 synchronized (mRenderData) {
455 boolean cursorMoved = mRenderData.setCursorPosition(newX, newY); 452 boolean cursorMoved = mRenderData.setCursorPosition(newX, newY);
456 if (cursorMoved) { 453 if (cursorMoved) {
457 mInputStrategy.injectCursorMoveEvent(newX, newY); 454 mInputStrategy.injectCursorMoveEvent(newX, newY);
458 } 455 }
459 } 456 }
457 mViewer.cursorMoved();
460 } 458 }
461 459
462 /** Processes a (multi-finger) swipe gesture. */ 460 /** Processes a (multi-finger) swipe gesture. */
463 private boolean onSwipe() { 461 private boolean onSwipe() {
464 if (mTotalMotionY > mSwipeThreshold) { 462 if (mTotalMotionY > mSwipeThreshold) {
465 // Swipe down occurred. 463 // Swipe down occurred.
466 mViewer.showActionBar(); 464 mViewer.showActionBar();
467 } else if (mTotalMotionY < -mSwipeThreshold) { 465 } else if (mTotalMotionY < -mSwipeThreshold) {
468 // Swipe up occurred. 466 // Swipe up occurred.
469 mViewer.showKeyboard(); 467 mViewer.showKeyboard();
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 case 2: 652 case 2:
655 return InputStub.BUTTON_RIGHT; 653 return InputStub.BUTTON_RIGHT;
656 case 3: 654 case 3:
657 return InputStub.BUTTON_MIDDLE; 655 return InputStub.BUTTON_MIDDLE;
658 default: 656 default:
659 return InputStub.BUTTON_UNDEFINED; 657 return InputStub.BUTTON_UNDEFINED;
660 } 658 }
661 } 659 }
662 } 660 }
663 } 661 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698