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

Unified Diff: chrome/browser/media_gallery/media_device_notifications_window_win.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 cros 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: chrome/browser/media_gallery/media_device_notifications_window_win.cc
===================================================================
--- chrome/browser/media_gallery/media_device_notifications_window_win.cc (revision 147551)
+++ chrome/browser/media_gallery/media_device_notifications_window_win.cc (working copy)
@@ -10,7 +10,7 @@
#include <string>
#include "base/file_path.h"
-#include "base/sys_string_conversions.h"
+#include "base/string_number_conversions.h"
#include "base/system_monitor/system_monitor.h"
#include "base/win/wrapped_window_proc.h"
#include "chrome/browser/media_gallery/media_device_notifications_utils.h"
@@ -102,7 +102,7 @@
BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
base::Bind(&MediaDeviceNotificationsWindowWin::
- CheckDeviceTypeOnFileThread, this, i,
+ CheckDeviceTypeOnFileThread, this, base::IntToString(i),
FilePath::StringType(volume_name), FilePath(drive)));
}
}
@@ -114,7 +114,7 @@
for (int i = 0; unitmask; ++i, unitmask >>= 1) {
if (unitmask & 0x01) {
base::SystemMonitor* monitor = base::SystemMonitor::Get();
- monitor->ProcessMediaDeviceDetached(i);
+ monitor->ProcessMediaDeviceDetached(base::IntToString(i));
}
}
break;
@@ -124,7 +124,7 @@
}
void MediaDeviceNotificationsWindowWin::CheckDeviceTypeOnFileThread(
- unsigned int id,
+ const std::string& id,
const FilePath::StringType& device_name,
const FilePath& path) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
@@ -140,14 +140,16 @@
}
void MediaDeviceNotificationsWindowWin::ProcessMediaDeviceAttachedOnUIThread(
- unsigned int id,
+ const std::string& id,
const FilePath::StringType& device_name,
const FilePath& path) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- const std::string device_name_utf8(base::SysWideToUTF8(device_name));
base::SystemMonitor* monitor = base::SystemMonitor::Get();
- monitor->ProcessMediaDeviceAttached(id, device_name_utf8, path);
+ monitor->ProcessMediaDeviceAttached(id,
+ device_name,
+ base::SystemMonitor::TYPE_PATH,
+ path.value());
}
LRESULT CALLBACK MediaDeviceNotificationsWindowWin::WndProc(

Powered by Google App Engine
This is Rietveld 408576698