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

Side by Side Diff: ui/events/devices/x11/device_data_manager_x11.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 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 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/devices/x11/device_data_manager_x11.h" 5 #include "ui/events/devices/x11/device_data_manager_x11.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <X11/extensions/XInput.h> 8 #include <X11/extensions/XInput.h>
9 #include <X11/extensions/XInput2.h> 9 #include <X11/extensions/XInput2.h>
10 #include <X11/Xlib.h> 10 #include <X11/Xlib.h>
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 double valuator) const { 795 double valuator) const {
796 double offset = 0; 796 double offset = 0;
797 if (axis->seen) 797 if (axis->seen)
798 offset = axis->position - valuator; 798 offset = axis->position - valuator;
799 axis->seen = true; 799 axis->seen = true;
800 axis->position = valuator; 800 axis->position = valuator;
801 return offset / axis->increment; 801 return offset / axis->increment;
802 } 802 }
803 803
804 void DeviceDataManagerX11::SetDisabledKeyboardAllowedKeys( 804 void DeviceDataManagerX11::SetDisabledKeyboardAllowedKeys(
805 scoped_ptr<std::set<KeyboardCode> > excepted_keys) { 805 std::unique_ptr<std::set<KeyboardCode>> excepted_keys) {
806 DCHECK(!excepted_keys.get() || 806 DCHECK(!excepted_keys.get() ||
807 !blocked_keyboard_allowed_keys_.get()); 807 !blocked_keyboard_allowed_keys_.get());
808 blocked_keyboard_allowed_keys_ = std::move(excepted_keys); 808 blocked_keyboard_allowed_keys_ = std::move(excepted_keys);
809 } 809 }
810 810
811 void DeviceDataManagerX11::DisableDevice(int deviceid) { 811 void DeviceDataManagerX11::DisableDevice(int deviceid) {
812 blocked_devices_.set(deviceid, true); 812 blocked_devices_.set(deviceid, true);
813 // TODO(rsadam@): Support blocking touchscreen devices. 813 // TODO(rsadam@): Support blocking touchscreen devices.
814 std::vector<KeyboardDevice> keyboards = keyboard_devices(); 814 std::vector<KeyboardDevice> keyboards = keyboard_devices();
815 std::vector<KeyboardDevice>::iterator it = 815 std::vector<KeyboardDevice>::iterator it =
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 } else { 874 } else {
875 keyboards.erase(it); 875 keyboards.erase(it);
876 ++blocked_iter; 876 ++blocked_iter;
877 } 877 }
878 } 878 }
879 // Notify base class of updated list. 879 // Notify base class of updated list.
880 DeviceDataManager::OnKeyboardDevicesUpdated(keyboards); 880 DeviceDataManager::OnKeyboardDevicesUpdated(keyboards);
881 } 881 }
882 882
883 } // namespace ui 883 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/devices/x11/device_data_manager_x11.h ('k') | ui/events/devices/x11/device_list_cache_x11.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698