Chromium Code Reviews| 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 343 // Unreachable, but required by Google Java style and findbugs. | 343 // Unreachable, but required by Google Java style and findbugs. |
| 344 assert false : "Unreached"; | 344 assert false : "Unreached"; |
| 345 } | 345 } |
| 346 | 346 |
| 347 // Ensure the cursor state is updated appropriately. | 347 // Ensure the cursor state is updated appropriately. |
| 348 mRenderStub.setCursorVisibility(mRenderData.drawCursor); | 348 mRenderStub.setCursorVisibility(mRenderData.drawCursor); |
| 349 } | 349 } |
| 350 | 350 |
| 351 private void handleSystemUiVisibilityChanged( | 351 private void handleSystemUiVisibilityChanged( |
| 352 SystemUiVisibilityChangedEventParameter parameter) { | 352 SystemUiVisibilityChangedEventParameter parameter) { |
| 353 if (parameter.systemUiVisible) { | 353 mDesktopCanvas.onSystemUiVisibilityChanged(parameter); |
|
Yuwei
2016/10/10 23:06:30
Maybe get rid of this private method and set mDesk
joedow
2016/10/10 23:22:47
Done
| |
| 354 mDesktopCanvas.setSystemUiOffsetValues(parameter.left, parameter.top , | |
| 355 mRenderData.screenWidth - parameter.right, | |
| 356 mRenderData.screenHeight - parameter.bottom); | |
| 357 } else { | |
| 358 mDesktopCanvas.clearSystemUiOffsets(); | |
| 359 } | |
| 360 } | 354 } |
| 361 | 355 |
| 362 private boolean handleTouchEvent(MotionEvent event) { | 356 private boolean handleTouchEvent(MotionEvent event) { |
| 363 // Give the underlying input strategy a chance to observe the current mo tion event before | 357 // Give the underlying input strategy a chance to observe the current mo tion event before |
| 364 // passing it to the gesture detectors. This allows the input strategy to react to the | 358 // passing it to the gesture detectors. This allows the input strategy to react to the |
| 365 // event or save the payload for use in recreating the gesture remotely. | 359 // event or save the payload for use in recreating the gesture remotely. |
| 366 mInputStrategy.onMotionEvent(event); | 360 mInputStrategy.onMotionEvent(event); |
| 367 | 361 |
| 368 // Avoid short-circuit logic evaluation - ensure all gesture detectors s ee all events so | 362 // Avoid short-circuit logic evaluation - ensure all gesture detectors s ee all events so |
| 369 // that they generate correct notifications. | 363 // that they generate correct notifications. |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 691 float[] mappedPoints = mapScreenPointToImagePoint(screenX, screenY); | 685 float[] mappedPoints = mapScreenPointToImagePoint(screenX, screenY); |
| 692 | 686 |
| 693 float imageWidth = (float) mRenderData.imageWidth + EPSILON; | 687 float imageWidth = (float) mRenderData.imageWidth + EPSILON; |
| 694 float imageHeight = (float) mRenderData.imageHeight + EPSILON; | 688 float imageHeight = (float) mRenderData.imageHeight + EPSILON; |
| 695 | 689 |
| 696 return mappedPoints[0] < -EPSILON || mappedPoints[0] > imageWidth | 690 return mappedPoints[0] < -EPSILON || mappedPoints[0] > imageWidth |
| 697 || mappedPoints[1] < -EPSILON || mappedPoints[1] > imageHeig ht; | 691 || mappedPoints[1] < -EPSILON || mappedPoints[1] > imageHeig ht; |
| 698 } | 692 } |
| 699 } | 693 } |
| 700 } | 694 } |
| OLD | NEW |