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

Unified Diff: base/system_monitor/system_monitor.cc

Issue 9363008: Add Media device notification to SystemMonitor and Mac impl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Turns out, we want a number id on Windows too Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: base/system_monitor/system_monitor.cc
diff --git a/base/system_monitor/system_monitor.cc b/base/system_monitor/system_monitor.cc
index 28fc70bf2b42a1dd21dc04880ac17efec4ea55ab..f6f812a6689a0fd23013261b340ea70024f3b09a 100644
--- a/base/system_monitor/system_monitor.cc
+++ b/base/system_monitor/system_monitor.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "base/message_loop.h"
+#include "base/string_util.h"
Lei Zhang 2012/02/14 02:14:24 not needed?
vandebo (ex-Chrome) 2012/02/14 21:23:23 Done.
#include "base/time.h"
namespace base {
@@ -83,6 +84,16 @@ void SystemMonitor::ProcessDevicesChanged() {
NotifyDevicesChanged();
}
+void SystemMonitor::ProcessMediaDeviceAttached(const DeviceIdType& id,
+ const std::string& name,
+ const FilePath& path) {
+ NotifyMediaDeviceAttached(id, name, path);
+}
+
+void SystemMonitor::ProcessMediaDeviceDetached(const DeviceIdType& id) {
+ NotifyMediaDeviceDetached(id);
+}
+
void SystemMonitor::AddPowerObserver(PowerObserver* obs) {
power_observer_list_->AddObserver(obs);
}
@@ -105,6 +116,20 @@ void SystemMonitor::NotifyDevicesChanged() {
&DevicesChangedObserver::OnDevicesChanged);
}
+void SystemMonitor::NotifyMediaDeviceAttached(const DeviceIdType& id,
+ const std::string& name,
+ const FilePath& path) {
+ DVLOG(1) << "MediaDeviceAttached with name " << name << " and id " << id;
+ devices_changed_observer_list_->Notify(
+ &DevicesChangedObserver::OnMediaDeviceAttached, id, name, path);
+}
+
+void SystemMonitor::NotifyMediaDeviceDetached(const DeviceIdType& id) {
+ DVLOG(1) << "MediaDeviceDetached for id " << id;
+ devices_changed_observer_list_->Notify(
+ &DevicesChangedObserver::OnMediaDeviceDetached, id);
+}
+
void SystemMonitor::NotifyPowerStateChange() {
DVLOG(1) << "PowerStateChange: " << (BatteryPower() ? "On" : "Off")
<< " battery";

Powered by Google App Engine
This is Rietveld 408576698