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

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

Issue 2058543002: Updating initial zoom level for remote connections in Android Client. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing CR Feedback Created 4 years, 6 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
« no previous file with comments | « remoting/android/java/src/org/chromium/chromoting/DesktopCanvas.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; 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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 347
348 default: 348 default:
349 break; 349 break;
350 } 350 }
351 return handled; 351 return handled;
352 } 352 }
353 353
354 private void handleClientSizeChanged(int width, int height) { 354 private void handleClientSizeChanged(int width, int height) {
355 mPanGestureBounds = new Rect( 355 mPanGestureBounds = new Rect(
356 mEdgeSlopInPx, mEdgeSlopInPx, width - mEdgeSlopInPx, height - mE dgeSlopInPx); 356 mEdgeSlopInPx, mEdgeSlopInPx, width - mEdgeSlopInPx, height - mE dgeSlopInPx);
357 mDesktopCanvas.repositionImageWithZoom(true); 357 resizeImageToFitScreen();
358 } 358 }
359 359
360 private void handleHostSizeChanged(int width, int height) { 360 private void handleHostSizeChanged(int width, int height) {
361 moveViewport((float) width / 2, (float) height / 2); 361 resizeImageToFitScreen();
362 }
363
364 private void resizeImageToFitScreen() {
362 mDesktopCanvas.resizeImageToFitScreen(); 365 mDesktopCanvas.resizeImageToFitScreen();
366 float screenCenterX;
367 float screenCenterY;
368 synchronized (mRenderData) {
369 screenCenterX = (float) mRenderData.screenWidth / 2;
370 screenCenterY = (float) mRenderData.screenHeight / 2;
371 }
372 moveCursorToScreenPoint(screenCenterX, screenCenterY);
363 } 373 }
364 374
365 private void setInputStrategy(InputStrategyInterface inputStrategy) { 375 private void setInputStrategy(InputStrategyInterface inputStrategy) {
366 // Since the rules for flinging differ between input modes, we want to s top running the 376 // Since the rules for flinging differ between input modes, we want to s top running the
367 // current fling animation when the mode changes to prevent a wonky expe rience. 377 // current fling animation when the mode changes to prevent a wonky expe rience.
368 mCursorAnimationJob.abortAnimation(); 378 mCursorAnimationJob.abortAnimation();
369 mScrollAnimationJob.abortAnimation(); 379 mScrollAnimationJob.abortAnimation();
370 mInputStrategy = inputStrategy; 380 mInputStrategy = inputStrategy;
371 } 381 }
372 382
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 case 2: 658 case 2:
649 return BUTTON_RIGHT; 659 return BUTTON_RIGHT;
650 case 3: 660 case 3:
651 return BUTTON_MIDDLE; 661 return BUTTON_MIDDLE;
652 default: 662 default:
653 return BUTTON_UNDEFINED; 663 return BUTTON_UNDEFINED;
654 } 664 }
655 } 665 }
656 } 666 }
657 } 667 }
OLDNEW
« no previous file with comments | « remoting/android/java/src/org/chromium/chromoting/DesktopCanvas.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698