Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(885)

Unified Diff: ui/android/java/src/org/chromium/ui/base/TouchDevice.java

Issue 1100763002: Inject CanAddURLToHistory into TopSitesImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefs
Patch Set: Fix error introduced during rebase Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/valgrind/memcheck/suppressions_mac.txt ('k') | ui/base/accelerators/accelerator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 440e95c8c281fcec789b123113506f856f6fc367..a5fc9793c2752c2fed43b90ce10870519357c7b1 100644
--- a/ui/android/java/src/org/chromium/ui/base/TouchDevice.java
+++ b/ui/android/java/src/org/chromium/ui/base/TouchDevice.java
@@ -57,7 +57,10 @@ public class TouchDevice {
int pointerTypesVal = 0;
for (int deviceId : InputDevice.getDeviceIds()) {
- int sources = InputDevice.getDevice(deviceId).getSources();
+ InputDevice inputDevice = InputDevice.getDevice(deviceId);
+ if (inputDevice == null) continue;
+
+ int sources = inputDevice.getSources();
if (hasSource(sources, InputDevice.SOURCE_MOUSE)
|| hasSource(sources, InputDevice.SOURCE_STYLUS)
@@ -84,7 +87,10 @@ public class TouchDevice {
int hoverTypesVal = 0;
for (int deviceId : InputDevice.getDeviceIds()) {
- int sources = InputDevice.getDevice(deviceId).getSources();
+ InputDevice inputDevice = InputDevice.getDevice(deviceId);
+ if (inputDevice == null) continue;
+
+ int sources = inputDevice.getSources();
if (hasSource(sources, InputDevice.SOURCE_MOUSE)
|| hasSource(sources, InputDevice.SOURCE_TOUCHPAD)
« no previous file with comments | « tools/valgrind/memcheck/suppressions_mac.txt ('k') | ui/base/accelerators/accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698