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

Unified Diff: chrome/browser/intents/device_attached_intent_source.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: chrome/browser/intents/device_attached_intent_source.cc
===================================================================
--- chrome/browser/intents/device_attached_intent_source.cc (revision 146883)
+++ chrome/browser/intents/device_attached_intent_source.cc (working copy)
@@ -33,14 +33,25 @@
void DeviceAttachedIntentSource::OnMediaDeviceAttached(
const base::SystemMonitor::DeviceIdType& id,
const std::string& name,
- const FilePath& device_path) {
+ base::SystemMonitor::MediaDeviceType type,
+ const string16& data) {
if (!browser_->window()->IsActive())
return;
+ // Only handle FilePaths for now.
+ if (type != SystemMonitor::TYPE_PATH)
+ return;
+
+ const FilePath device_path =
+#if defined(OS_POSIX)
+ FilePath(UTF16ToUTF8(data));
+#else
+ FilePath(data);
+#endif
+
// Sanity checks for |device_path|.
- if (!device_path.IsAbsolute() || device_path.ReferencesParent()) {
+ if (!device_path.IsAbsolute() || device_path.ReferencesParent())
return;
- }
std::string device_name;

Powered by Google App Engine
This is Rietveld 408576698