| Index: ui/android/java/src/org/chromium/ui/base/TouchDevice.java
|
| diff --git a/ui/android/java/src/org/chromium/ui/base/TouchDevice.java b/ui/android/java/src/org/chromium/ui/base/TouchDevice.java
|
| index 21b28c66d491461082c6fe0c69ef1aa51d2479d8..86d6a1358d82430501aaf8e4fdb57acb1e14dfec 100644
|
| --- a/ui/android/java/src/org/chromium/ui/base/TouchDevice.java
|
| +++ b/ui/android/java/src/org/chromium/ui/base/TouchDevice.java
|
| @@ -65,18 +65,21 @@ public class TouchDevice {
|
|
|
| int sources = inputDevice.getSources();
|
|
|
| - if (hasAnySource(sources, InputDevice.SOURCE_MOUSE | InputDevice.SOURCE_STYLUS
|
| - | InputDevice.SOURCE_TOUCHPAD | InputDevice.SOURCE_TRACKBALL)) {
|
| + if (hasSource(sources, InputDevice.SOURCE_MOUSE)
|
| + || hasSource(sources, InputDevice.SOURCE_STYLUS)
|
| + || hasSource(sources, InputDevice.SOURCE_TOUCHPAD)
|
| + || hasSource(sources, InputDevice.SOURCE_TRACKBALL)) {
|
| result[0] |= PointerType.FINE;
|
| } else if (hasSource(sources, InputDevice.SOURCE_TOUCHSCREEN)) {
|
| result[0] |= PointerType.COARSE;
|
| }
|
|
|
| - if (hasAnySource(sources, InputDevice.SOURCE_MOUSE | InputDevice.SOURCE_TOUCHPAD
|
| - | InputDevice.SOURCE_TRACKBALL)) {
|
| + if (hasSource(sources, InputDevice.SOURCE_MOUSE)
|
| + || hasSource(sources, InputDevice.SOURCE_TOUCHPAD)
|
| + || hasSource(sources, InputDevice.SOURCE_TRACKBALL)) {
|
| result[1] |= HoverType.HOVER;
|
| - } else if (hasAnySource(sources,
|
| - InputDevice.SOURCE_STYLUS | InputDevice.SOURCE_TOUCHSCREEN)) {
|
| + } else if (hasSource(sources, InputDevice.SOURCE_STYLUS)
|
| + || hasSource(sources, InputDevice.SOURCE_TOUCHSCREEN)) {
|
| result[1] |= HoverType.ON_DEMAND;
|
| }
|
|
|
| @@ -90,10 +93,6 @@ public class TouchDevice {
|
| return result;
|
| }
|
|
|
| - private static boolean hasAnySource(int sources, int inputDeviceSources) {
|
| - return (sources & inputDeviceSources) != 0;
|
| - }
|
| -
|
| private static boolean hasSource(int sources, int inputDeviceSource) {
|
| return (sources & inputDeviceSource) == inputDeviceSource;
|
| }
|
|
|