| 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.content.Context; | 7 import android.content.Context; |
| 8 import android.graphics.Matrix; | 8 import android.graphics.Matrix; |
| 9 import android.graphics.PointF; | 9 import android.graphics.PointF; |
| 10 import android.graphics.Rect; | 10 import android.graphics.Rect; |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 parameter.hostCapability; | 320 parameter.hostCapability; |
| 321 // We need both input mode and host input capabilities to select the inp
ut | 321 // We need both input mode and host input capabilities to select the inp
ut |
| 322 // strategy. | 322 // strategy. |
| 323 if (!inputMode.isSet() || !hostTouchCapability.isSet()) { | 323 if (!inputMode.isSet() || !hostTouchCapability.isSet()) { |
| 324 return; | 324 return; |
| 325 } | 325 } |
| 326 | 326 |
| 327 switch (inputMode) { | 327 switch (inputMode) { |
| 328 case TRACKPAD: | 328 case TRACKPAD: |
| 329 setInputStrategy(new TrackpadInputStrategy(mRenderData, injector
)); | 329 setInputStrategy(new TrackpadInputStrategy(mRenderData, injector
)); |
| 330 mDesktopCanvas.adjustViewportForSystemUi(true); |
| 330 moveCursorToScreenCenter(); | 331 moveCursorToScreenCenter(); |
| 331 break; | 332 break; |
| 332 | 333 |
| 333 case TOUCH: | 334 case TOUCH: |
| 335 mDesktopCanvas.adjustViewportForSystemUi(false); |
| 334 if (hostTouchCapability.isSupported()) { | 336 if (hostTouchCapability.isSupported()) { |
| 335 setInputStrategy(new TouchInputStrategy(mRenderData, injecto
r)); | 337 setInputStrategy(new TouchInputStrategy(mRenderData, injecto
r)); |
| 336 } else { | 338 } else { |
| 337 setInputStrategy( | 339 setInputStrategy( |
| 338 new SimulatedTouchInputStrategy(mRenderData, injecto
r, mContext)); | 340 new SimulatedTouchInputStrategy(mRenderData, injecto
r, mContext)); |
| 339 } | 341 } |
| 340 break; | 342 break; |
| 341 | 343 |
| 342 default: | 344 default: |
| 343 // Unreachable, but required by Google Java style and findbugs. | 345 // Unreachable, but required by Google Java style and findbugs. |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 float[] mappedPoints = mapScreenPointToImagePoint(screenX, screenY); | 693 float[] mappedPoints = mapScreenPointToImagePoint(screenX, screenY); |
| 692 | 694 |
| 693 float imageWidth = (float) mRenderData.imageWidth + EPSILON; | 695 float imageWidth = (float) mRenderData.imageWidth + EPSILON; |
| 694 float imageHeight = (float) mRenderData.imageHeight + EPSILON; | 696 float imageHeight = (float) mRenderData.imageHeight + EPSILON; |
| 695 | 697 |
| 696 return mappedPoints[0] < -EPSILON || mappedPoints[0] > imageWidth | 698 return mappedPoints[0] < -EPSILON || mappedPoints[0] > imageWidth |
| 697 || mappedPoints[1] < -EPSILON || mappedPoints[1] > imageHeig
ht; | 699 || mappedPoints[1] < -EPSILON || mappedPoints[1] > imageHeig
ht; |
| 698 } | 700 } |
| 699 } | 701 } |
| 700 } | 702 } |
| OLD | NEW |