| 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 "ui/events/devices/x11/device_data_manager_x11.h" | 5 #include "ui/events/devices/x11/device_data_manager_x11.h" |
| 6 | 6 |
| 7 #include <X11/extensions/XInput.h> | 7 #include <X11/extensions/XInput.h> |
| 8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
| 9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
| 10 | 10 |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 data_type_lookup_[deviceid][valuator_count_[deviceid]] = j; | 661 data_type_lookup_[deviceid][valuator_count_[deviceid]] = j; |
| 662 valuator_min_[deviceid][j] = min_value; | 662 valuator_min_[deviceid][j] = min_value; |
| 663 valuator_max_[deviceid][j] = max_value; | 663 valuator_max_[deviceid][j] = max_value; |
| 664 valuator_count_[deviceid]++; | 664 valuator_count_[deviceid]++; |
| 665 } | 665 } |
| 666 } | 666 } |
| 667 | 667 |
| 668 bool DeviceDataManagerX11::TouchEventNeedsCalibrate( | 668 bool DeviceDataManagerX11::TouchEventNeedsCalibrate( |
| 669 unsigned int touch_device_id) const { | 669 unsigned int touch_device_id) const { |
| 670 #if defined(OS_CHROMEOS) && defined(USE_X11) | 670 #if defined(OS_CHROMEOS) && defined(USE_X11) |
| 671 int64 touch_display_id = GetDisplayForTouchDevice(touch_device_id); | 671 gfx::Display touch_display = GetDisplayForTouchDevice(touch_device_id); |
| 672 if (base::SysInfo::IsRunningOnChromeOS() && | 672 if (base::SysInfo::IsRunningOnChromeOS() && touch_display.IsInternal()) |
| 673 touch_display_id == gfx::Display::InternalDisplayId()) { | |
| 674 return true; | 673 return true; |
| 675 } | |
| 676 #endif // defined(OS_CHROMEOS) && defined(USE_X11) | 674 #endif // defined(OS_CHROMEOS) && defined(USE_X11) |
| 677 return false; | 675 return false; |
| 678 } | 676 } |
| 679 | 677 |
| 680 void DeviceDataManagerX11::SetDisabledKeyboardAllowedKeys( | 678 void DeviceDataManagerX11::SetDisabledKeyboardAllowedKeys( |
| 681 scoped_ptr<std::set<KeyboardCode> > excepted_keys) { | 679 scoped_ptr<std::set<KeyboardCode> > excepted_keys) { |
| 682 DCHECK(!excepted_keys.get() || | 680 DCHECK(!excepted_keys.get() || |
| 683 !blocked_keyboard_allowed_keys_.get()); | 681 !blocked_keyboard_allowed_keys_.get()); |
| 684 blocked_keyboard_allowed_keys_ = excepted_keys.Pass(); | 682 blocked_keyboard_allowed_keys_ = excepted_keys.Pass(); |
| 685 } | 683 } |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 } else { | 751 } else { |
| 754 keyboards.erase(it); | 752 keyboards.erase(it); |
| 755 ++blocked_iter; | 753 ++blocked_iter; |
| 756 } | 754 } |
| 757 } | 755 } |
| 758 // Notify base class of updated list. | 756 // Notify base class of updated list. |
| 759 DeviceDataManager::OnKeyboardDevicesUpdated(keyboards); | 757 DeviceDataManager::OnKeyboardDevicesUpdated(keyboards); |
| 760 } | 758 } |
| 761 | 759 |
| 762 } // namespace ui | 760 } // namespace ui |
| OLD | NEW |