| 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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 // Unreachable, but required by Google Java style and findbugs. | 342 // Unreachable, but required by Google Java style and findbugs. |
| 343 assert false : "Unreached"; | 343 assert false : "Unreached"; |
| 344 } | 344 } |
| 345 | 345 |
| 346 // Ensure the cursor state is updated appropriately. | 346 // Ensure the cursor state is updated appropriately. |
| 347 mRenderStub.setCursorVisibility(mRenderData.drawCursor); | 347 mRenderStub.setCursorVisibility(mRenderData.drawCursor); |
| 348 } | 348 } |
| 349 | 349 |
| 350 private void handleSystemUiVisibilityChanged( | 350 private void handleSystemUiVisibilityChanged( |
| 351 SystemUiVisibilityChangedEventParameter parameter) { | 351 SystemUiVisibilityChangedEventParameter parameter) { |
| 352 if (parameter.softInputMethodVisible) { | 352 if (parameter.systemUiVisible) { |
| 353 mDesktopCanvas.setSystemUiOffsetValues(parameter.left, parameter.top
, | 353 mDesktopCanvas.setSystemUiOffsetValues(parameter.left, parameter.top
, |
| 354 mRenderData.screenWidth - parameter.right, | 354 mRenderData.screenWidth - parameter.right, |
| 355 mRenderData.screenHeight - parameter.bottom); | 355 mRenderData.screenHeight - parameter.bottom); |
| 356 } else { | 356 } else { |
| 357 mDesktopCanvas.setSystemUiOffsetValues(0, 0, 0, 0); | 357 mDesktopCanvas.clearSystemUiOffsets(); |
| 358 } | 358 } |
| 359 | 359 |
| 360 mDesktopCanvas.repositionImage(true); | 360 mDesktopCanvas.repositionImage(true); |
| 361 } | 361 } |
| 362 | 362 |
| 363 private boolean handleTouchEvent(MotionEvent event) { | 363 private boolean handleTouchEvent(MotionEvent event) { |
| 364 // Give the underlying input strategy a chance to observe the current mo
tion event before | 364 // Give the underlying input strategy a chance to observe the current mo
tion event before |
| 365 // passing it to the gesture detectors. This allows the input strategy
to react to the | 365 // passing it to the gesture detectors. This allows the input strategy
to react to the |
| 366 // event or save the payload for use in recreating the gesture remotely. | 366 // event or save the payload for use in recreating the gesture remotely. |
| 367 mInputStrategy.onMotionEvent(event); | 367 mInputStrategy.onMotionEvent(event); |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 float[] mappedPoints = mapScreenPointToImagePoint(screenX, screenY); | 692 float[] mappedPoints = mapScreenPointToImagePoint(screenX, screenY); |
| 693 | 693 |
| 694 float imageWidth = (float) mRenderData.imageWidth + EPSILON; | 694 float imageWidth = (float) mRenderData.imageWidth + EPSILON; |
| 695 float imageHeight = (float) mRenderData.imageHeight + EPSILON; | 695 float imageHeight = (float) mRenderData.imageHeight + EPSILON; |
| 696 | 696 |
| 697 return mappedPoints[0] < -EPSILON || mappedPoints[0] > imageWidth | 697 return mappedPoints[0] < -EPSILON || mappedPoints[0] > imageWidth |
| 698 || mappedPoints[1] < -EPSILON || mappedPoints[1] > imageHeig
ht; | 698 || mappedPoints[1] < -EPSILON || mappedPoints[1] > imageHeig
ht; |
| 699 } | 699 } |
| 700 } | 700 } |
| 701 } | 701 } |
| OLD | NEW |