
The DeviceMonitorLinux detects device change and sends the signal to SystemMonitor. This patch depends on http://codereview.chromium.org/10836004/ BUG=137799 Review URL: https://chromiumcodereview.appspot.com/10829073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149266 0039d316-1c4b-4281-b951-d872f2087c98
45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
// This class is used to detect device change and notify base::SystemMonitor
|
|
// on Linux.
|
|
|
|
#ifndef CONTENT_BROWSER_DEVICE_MONITOR_LINUX_H_
|
|
#define CONTENT_BROWSER_DEVICE_MONITOR_LINUX_H_
|
|
|
|
#include "base/basictypes.h"
|
|
#include "base/memory/scoped_ptr.h"
|
|
#include "base/message_loop.h"
|
|
|
|
extern "C" {
|
|
struct udev_device;
|
|
}
|
|
|
|
namespace content {
|
|
|
|
class UdevLinux;
|
|
|
|
class DeviceMonitorLinux : public MessageLoop::DestructionObserver {
|
|
public:
|
|
DeviceMonitorLinux();
|
|
virtual ~DeviceMonitorLinux();
|
|
|
|
private:
|
|
// This object is deleted on the UI thread after the IO thread has been
|
|
// destroyed. Need to know when IO thread is being destroyed so that
|
|
// we can delete udev_.
|
|
virtual void WillDestroyCurrentMessageLoop() OVERRIDE;
|
|
|
|
void Initialize();
|
|
void OnDevicesChanged(udev_device* device);
|
|
|
|
scoped_ptr<UdevLinux> udev_;
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(DeviceMonitorLinux);
|
|
};
|
|
|
|
} // namespace content
|
|
|
|
#endif // CONTENT_BROWSER_DEVICE_MONITOR_LINUX_H_
|