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

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: 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..f3254d009d90c5b79c43e36bd2f7058fe86719e9 100644
--- a/base/system_monitor/system_monitor.cc
+++ b/base/system_monitor/system_monitor.cc
@@ -83,6 +83,17 @@ void SystemMonitor::ProcessDevicesChanged() {
NotifyDevicesChanged();
}
+void SystemMonitor::ProcessMediaDeviceAttached(const std::string& name,
+ const FilePath& path) {
+ NotifyDevicesChanged();
tpayne 2012/02/08 16:20:30 At least on windows, this will end up getting call
vandebo (ex-Chrome) 2012/02/08 18:37:01 Yea, I realized that on my drive home. Maybe we s
+ NotifyMediaDeviceAttached(name, path);
+}
+
+void SystemMonitor::ProcessMediaDeviceDetached(const std::string& name) {
+ NotifyDevicesChanged();
+ NotifyMediaDeviceDetached(name);
+}
+
void SystemMonitor::AddPowerObserver(PowerObserver* obs) {
power_observer_list_->AddObserver(obs);
}
@@ -105,6 +116,17 @@ void SystemMonitor::NotifyDevicesChanged() {
&DevicesChangedObserver::OnDevicesChanged);
}
+void SystemMonitor::NotifyMediaDeviceAttached(const std::string& name,
+ const FilePath& path) {
+ devices_changed_observer_list_->Notify(
+ &DevicesChangedObserver::OnMediaDeviceAttached, name, path);
+}
+
+void SystemMonitor::NotifyMediaDeviceDetached(const std::string& name) {
+ devices_changed_observer_list_->Notify(
+ &DevicesChangedObserver::OnMediaDeviceDetached, name);
+}
+
void SystemMonitor::NotifyPowerStateChange() {
DVLOG(1) << "PowerStateChange: " << (BatteryPower() ? "On" : "Off")
<< " battery";

Powered by Google App Engine
This is Rietveld 408576698