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

Side by Side Diff: ui/events/ozone/evdev/input_controller_evdev.cc

Issue 806693009: Port ScopedDisableInternalMouseAndKeyboardX11 to Ozone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
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 "ui/events/ozone/evdev/input_controller_evdev.h" 5 #include "ui/events/ozone/evdev/input_controller_evdev.h"
6 6
7 #include <linux/input.h> 7 #include <linux/input.h>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ui/events/ozone/evdev/event_factory_evdev.h" 10 #include "ui/events/ozone/evdev/event_factory_evdev.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 66
67 bool InputControllerEvdev::HasMouse() { 67 bool InputControllerEvdev::HasMouse() {
68 return event_factory_->GetDeviceIdsByType(DT_MOUSE, NULL); 68 return event_factory_->GetDeviceIdsByType(DT_MOUSE, NULL);
69 } 69 }
70 70
71 bool InputControllerEvdev::HasTouchpad() { 71 bool InputControllerEvdev::HasTouchpad() {
72 return event_factory_->GetDeviceIdsByType(DT_TOUCHPAD, NULL); 72 return event_factory_->GetDeviceIdsByType(DT_TOUCHPAD, NULL);
73 } 73 }
74 74
75 void InputControllerEvdev::DisableInternalTouchpad() {
76 event_factory_->DisableInternalTouchpad();
77 }
78
79 void InputControllerEvdev::EnableInternalTouchpad() {
80 event_factory_->EnableInternalTouchpad();
81 }
82
83 void InputControllerEvdev::DisableInternalKeyboardExceptKeys(
84 scoped_ptr<std::set<KeyboardCode>> excepted_keys) {
85 event_factory_->DisableInternalKeyboardExceptKeys(excepted_keys.Pass());
86 }
87
88 void InputControllerEvdev::EnableInternalKeyboard() {
89 event_factory_->EnableInternalKeyboard();
90 }
91
75 void InputControllerEvdev::SetIntPropertyForOneType(const EventDeviceType type, 92 void InputControllerEvdev::SetIntPropertyForOneType(const EventDeviceType type,
76 const std::string& name, 93 const std::string& name,
77 int value) { 94 int value) {
78 #if defined(USE_EVDEV_GESTURES) 95 #if defined(USE_EVDEV_GESTURES)
79 std::vector<int> ids; 96 std::vector<int> ids;
80 event_factory_->GetDeviceIdsByType(type, &ids); 97 event_factory_->GetDeviceIdsByType(type, &ids);
81 for (size_t i = 0; i < ids.size(); ++i) { 98 for (size_t i = 0; i < ids.size(); ++i) {
82 SetGestureIntProperty(gesture_property_provider_, ids[i], name, value); 99 SetGestureIntProperty(gesture_property_provider_, ids[i], name, value);
83 } 100 }
84 #endif 101 #endif
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 SetIntPropertyForOneType(DT_MOUSE, "Pointer Sensitivity", value); 142 SetIntPropertyForOneType(DT_MOUSE, "Pointer Sensitivity", value);
126 SetIntPropertyForOneType(DT_MOUSE, "Scroll Sensitivity", value); 143 SetIntPropertyForOneType(DT_MOUSE, "Scroll Sensitivity", value);
127 } 144 }
128 145
129 void InputControllerEvdev::SetPrimaryButtonRight(bool right) { 146 void InputControllerEvdev::SetPrimaryButtonRight(bool right) {
130 button_map_->UpdateButtonMap(BTN_LEFT, right ? BTN_RIGHT : BTN_LEFT); 147 button_map_->UpdateButtonMap(BTN_LEFT, right ? BTN_RIGHT : BTN_LEFT);
131 button_map_->UpdateButtonMap(BTN_RIGHT, right ? BTN_LEFT : BTN_RIGHT); 148 button_map_->UpdateButtonMap(BTN_RIGHT, right ? BTN_LEFT : BTN_RIGHT);
132 } 149 }
133 150
134 } // namespace ui 151 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698