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

Side by Side Diff: ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.cc

Issue 2028593004: Add new InputDeviceManager interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_keyboard
Patch Set: Fix windows compile error. Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « ash/virtual_keyboard_controller.cc ('k') | chrome/browser/chromeos/events/event_rewriter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h" 5 #include "ash/wm/maximize_mode/scoped_disable_internal_mouse_and_keyboard_x11.h"
6 6
7 #include <X11/extensions/XInput2.h> 7 #include <X11/extensions/XInput2.h>
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 device_data_manager->DisableDevice(touchpad_device_id_); 91 device_data_manager->DisableDevice(touchpad_device_id_);
92 Shell::GetInstance()->cursor_manager()->HideCursor(); 92 Shell::GetInstance()->cursor_manager()->HideCursor();
93 } 93 }
94 } else if (device_name == kCoreKeyboardName) { 94 } else if (device_name == kCoreKeyboardName) {
95 core_keyboard_device_id_ = xi_dev_list[i].deviceid; 95 core_keyboard_device_id_ = xi_dev_list[i].deviceid;
96 device_data_manager->DisableDevice(core_keyboard_device_id_); 96 device_data_manager->DisableDevice(core_keyboard_device_id_);
97 } 97 }
98 } 98 }
99 99
100 for (const ui::InputDevice& device : 100 for (const ui::InputDevice& device :
101 device_data_manager->keyboard_devices()) { 101 device_data_manager->GetKeyboardDevices()) {
102 if (device.type == ui::InputDeviceType::INPUT_DEVICE_INTERNAL) { 102 if (device.type == ui::InputDeviceType::INPUT_DEVICE_INTERNAL) {
103 keyboard_device_id_ = device.id; 103 keyboard_device_id_ = device.id;
104 device_data_manager->DisableDevice(keyboard_device_id_); 104 device_data_manager->DisableDevice(keyboard_device_id_);
105 break; 105 break;
106 } 106 }
107 } 107 }
108 } 108 }
109 // Allow the accessible keys present on the side of some devices to continue 109 // Allow the accessible keys present on the side of some devices to continue
110 // working. 110 // working.
111 std::unique_ptr<std::set<ui::KeyboardCode>> excepted_keys( 111 std::unique_ptr<std::set<ui::KeyboardCode>> excepted_keys(
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 // blocked. Move the mouse cursor back to its last known location resulting 159 // blocked. Move the mouse cursor back to its last known location resulting
160 // from an external mouse to prevent the internal touchpad from moving it. 160 // from an external mouse to prevent the internal touchpad from moving it.
161 SetMouseLocationInScreen(last_mouse_location_); 161 SetMouseLocationInScreen(last_mouse_location_);
162 } else { 162 } else {
163 // Track the last location seen from an external mouse event. 163 // Track the last location seen from an external mouse event.
164 last_mouse_location_ = GetMouseLocationInScreen(); 164 last_mouse_location_ = GetMouseLocationInScreen();
165 } 165 }
166 } 166 }
167 167
168 } // namespace ash 168 } // namespace ash
OLDNEW
« no previous file with comments | « ash/virtual_keyboard_controller.cc ('k') | chrome/browser/chromeos/events/event_rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698