| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/chromeos/events/event_rewriter.h" | 5 #include "chrome/browser/chromeos/events/event_rewriter.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/sticky_keys/sticky_keys_controller.h" | 9 #include "ash/sticky_keys/sticky_keys_controller.h" |
| 10 #include "ash/wm/window_state.h" | 10 #include "ash/wm/window_state.h" |
| (...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 948 XIDeviceInfo* device_info = | 948 XIDeviceInfo* device_info = |
| 949 XIQueryDevice(gfx::GetXDisplay(), device_id, &ndevices_return); | 949 XIQueryDevice(gfx::GetXDisplay(), device_id, &ndevices_return); |
| 950 | 950 |
| 951 // Since |device_id| is neither XIAllDevices nor XIAllMasterDevices, | 951 // Since |device_id| is neither XIAllDevices nor XIAllMasterDevices, |
| 952 // the number of devices found should be either 0 (not found) or 1. | 952 // the number of devices found should be either 0 (not found) or 1. |
| 953 if (!device_info) { | 953 if (!device_info) { |
| 954 LOG(ERROR) << "XIQueryDevice: Device ID " << device_id << " is unknown."; | 954 LOG(ERROR) << "XIQueryDevice: Device ID " << device_id << " is unknown."; |
| 955 return kDeviceUnknown; | 955 return kDeviceUnknown; |
| 956 } | 956 } |
| 957 | 957 |
| 958 DeviceType dev_type; | 958 DeviceType dev_type = kDeviceUnknown; |
| 959 DCHECK_EQ(1, ndevices_return); | 959 DCHECK_EQ(1, ndevices_return); |
| 960 for (int i = 0; i < ndevices_return; ++i) { | 960 for (int i = 0; i < ndevices_return; ++i) { |
| 961 // Get keyboard product and vendor id. | 961 // Get keyboard product and vendor id. |
| 962 int vendor_id = kUnknownVendorId; | 962 int vendor_id = kUnknownVendorId; |
| 963 int product_id = kUnknownProductId; | 963 int product_id = kUnknownProductId; |
| 964 uint32* product_info = NULL; | 964 uint32* product_info = NULL; |
| 965 Atom type; | 965 Atom type; |
| 966 int format_return; | 966 int format_return; |
| 967 unsigned long num_items_return; | 967 unsigned long num_items_return; |
| 968 unsigned long bytes_after_return; | 968 unsigned long bytes_after_return; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 996 // TODO(spang): Figure out where we can get keyboard vendor/product id from in | 996 // TODO(spang): Figure out where we can get keyboard vendor/product id from in |
| 997 // Ozone/Freon version. | 997 // Ozone/Freon version. |
| 998 return KeyboardDeviceAddedInternal(device_id, | 998 return KeyboardDeviceAddedInternal(device_id, |
| 999 "keyboard", | 999 "keyboard", |
| 1000 kUnknownVendorId, | 1000 kUnknownVendorId, |
| 1001 kUnknownProductId); | 1001 kUnknownProductId); |
| 1002 #endif | 1002 #endif |
| 1003 } | 1003 } |
| 1004 | 1004 |
| 1005 } // namespace chromeos | 1005 } // namespace chromeos |
| OLD | NEW |