| 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.Bitmap; | 8 import android.graphics.Bitmap; |
| 9 import android.graphics.Canvas; | 9 import android.graphics.Canvas; |
| 10 import android.graphics.Color; | 10 import android.graphics.Color; |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 mRenderData.cursorPosition.y = y; | 337 mRenderData.cursorPosition.y = y; |
| 338 cursorMoved = true; | 338 cursorMoved = true; |
| 339 } | 339 } |
| 340 } | 340 } |
| 341 | 341 |
| 342 if (button == TouchInputHandler.BUTTON_UNDEFINED && !cursorMoved) { | 342 if (button == TouchInputHandler.BUTTON_UNDEFINED && !cursorMoved) { |
| 343 // No need to inject anything or repaint. | 343 // No need to inject anything or repaint. |
| 344 return; | 344 return; |
| 345 } | 345 } |
| 346 | 346 |
| 347 JniInterface.mouseAction(x, y, button, pressed); | 347 JniInterface.sendMouseEvent(x, y, button, pressed); |
| 348 if (cursorMoved) { | 348 if (cursorMoved) { |
| 349 // TODO(lambroslambrou): Optimize this by only repainting the affect
ed areas. | 349 // TODO(lambroslambrou): Optimize this by only repainting the affect
ed areas. |
| 350 requestRepaint(); | 350 requestRepaint(); |
| 351 } | 351 } |
| 352 } | 352 } |
| 353 | 353 |
| 354 @Override | 354 @Override |
| 355 public void injectMouseWheelDeltaEvent(int deltaX, int deltaY) { | 355 public void injectMouseWheelDeltaEvent(int deltaX, int deltaY) { |
| 356 JniInterface.mouseWheelDeltaAction(deltaX, deltaY); | 356 JniInterface.sendMouseWheelEvent(deltaX, deltaY); |
| 357 } | 357 } |
| 358 | 358 |
| 359 @Override | 359 @Override |
| 360 public void showLongPressFeedback() { | 360 public void showLongPressFeedback() { |
| 361 mFeedbackAnimator.startAnimation(); | 361 mFeedbackAnimator.startAnimation(); |
| 362 requestRepaint(); | 362 requestRepaint(); |
| 363 } | 363 } |
| 364 | 364 |
| 365 @Override | 365 @Override |
| 366 public void showActionBar() { | 366 public void showActionBar() { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 382 @Override | 382 @Override |
| 383 public void setAnimationEnabled(boolean enabled) { | 383 public void setAnimationEnabled(boolean enabled) { |
| 384 synchronized (mAnimationLock) { | 384 synchronized (mAnimationLock) { |
| 385 if (enabled && !mInputAnimationRunning) { | 385 if (enabled && !mInputAnimationRunning) { |
| 386 requestRepaint(); | 386 requestRepaint(); |
| 387 } | 387 } |
| 388 mInputAnimationRunning = enabled; | 388 mInputAnimationRunning = enabled; |
| 389 } | 389 } |
| 390 } | 390 } |
| 391 } | 391 } |
| OLD | NEW |