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

Unified Diff: base/system_monitor/system_monitor.cc

Issue 10780023: Change base::SystemMonitor's media device functions to take a type and string16 instead of a FilePa… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix win Created 8 years, 5 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
===================================================================
--- base/system_monitor/system_monitor.cc (revision 146883)
+++ base/system_monitor/system_monitor.cc (working copy)
@@ -6,10 +6,10 @@
#include <utility>
-#include "base/file_path.h"
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/time.h"
+#include "base/utf_string_conversions.h"
namespace base {
@@ -88,11 +88,24 @@
void SystemMonitor::ProcessMediaDeviceAttached(const DeviceIdType& id,
const std::string& name,
- const FilePath& path) {
- media_device_map_.insert(std::make_pair(id, MakeTuple(id, name, path)));
- NotifyMediaDeviceAttached(id, name, path);
+ MediaDeviceType type,
+ const string16& data) {
+ media_device_map_.insert(std::make_pair(id, MakeTuple(id, name, type, data)));
+ NotifyMediaDeviceAttached(id, name, type, data);
}
+#if defined(OS_POSIX)
+void SystemMonitor::ProcessMediaDeviceAttached(const DeviceIdType& id,
+ const std::string& name,
+ MediaDeviceType type,
+ const std::string& data) {
+ string16 data16 = UTF8ToUTF16(data);
+ media_device_map_.insert(
vandebo (ex-Chrome) 2012/07/19 19:05:20 Call the other ProcessMediaDeviceAttach with the c
Lei Zhang 2012/07/19 23:07:25 I removed this since we switched to FilePath::Stri
+ std::make_pair(id, MakeTuple(id, name, type, data16)));
+ NotifyMediaDeviceAttached(id, name, type, data16);
+}
+#endif
+
void SystemMonitor::ProcessMediaDeviceDetached(const DeviceIdType& id) {
MediaDeviceMap::iterator it = media_device_map_.find(id);
if (it != media_device_map_.end())
@@ -135,10 +148,11 @@
void SystemMonitor::NotifyMediaDeviceAttached(const DeviceIdType& id,
const std::string& name,
- const FilePath& path) {
+ MediaDeviceType type,
+ const string16& data) {
DVLOG(1) << "MediaDeviceAttached with name " << name << " and id " << id;
devices_changed_observer_list_->Notify(
- &DevicesChangedObserver::OnMediaDeviceAttached, id, name, path);
+ &DevicesChangedObserver::OnMediaDeviceAttached, id, name, type, data);
}
void SystemMonitor::NotifyMediaDeviceDetached(const DeviceIdType& id) {

Powered by Google App Engine
This is Rietveld 408576698