Check USB device path access when prompting users to select a device.
[chromium-blink-merge.git] / chrome / browser / chromeos / system / device_change_handler.cc
blobe66314bcb43a531bb829f0b320413f8877bdcf32
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/chromeos/system/device_change_handler.h"
7 #include "chrome/browser/chromeos/system/input_device_settings.h"
9 namespace chromeos {
10 namespace system {
12 DeviceChangeHandler::DeviceChangeHandler()
13 : pointer_device_observer_(new PointerDeviceObserver) {
14 pointer_device_observer_->AddObserver(this);
15 pointer_device_observer_->Init();
17 // Apply settings on startup.
18 TouchpadExists(true);
19 MouseExists(true);
22 DeviceChangeHandler::~DeviceChangeHandler() {
23 pointer_device_observer_->RemoveObserver(this);
26 // When we detect a touchpad is attached, apply touchpad settings that was
27 // cached inside InputDeviceSettings.
28 void DeviceChangeHandler::TouchpadExists(bool exists) {
29 if (!exists)
30 return;
31 system::InputDeviceSettings::Get()->ReapplyTouchpadSettings();
34 // When we detect a mouse is attached, apply mouse settings that was cached
35 // inside InputDeviceSettings.
36 void DeviceChangeHandler::MouseExists(bool exists) {
37 if (!exists)
38 return;
39 system::InputDeviceSettings::Get()->ReapplyMouseSettings();
42 } // namespace system
43 } // namespace chromeos