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"
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.
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
) {
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
) {
39 system::InputDeviceSettings::Get()->ReapplyMouseSettings();
43 } // namespace chromeos