OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // MediaDeviceNotificationsLinux implementation. | 5 // MediaDeviceNotificationsLinux implementation. |
6 | 6 |
7 #include "chrome/browser/media_gallery/media_device_notifications_linux.h" | 7 #include "chrome/browser/media_gallery/media_device_notifications_linux.h" |
8 | 8 |
9 #include <mntent.h> | 9 #include <mntent.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 // The current entry is newer, update the mount point entry. | 212 // The current entry is newer, update the mount point entry. |
213 existing_device = device; | 213 existing_device = device; |
214 existing_position = position; | 214 existing_position = position; |
215 } | 215 } |
216 } | 216 } |
217 | 217 |
218 void MediaDeviceNotificationsLinux::AddNewDevice( | 218 void MediaDeviceNotificationsLinux::AddNewDevice( |
219 const std::string& mount_device, | 219 const std::string& mount_device, |
220 const std::string& mount_point, | 220 const std::string& mount_point, |
221 std::string* device_id) { | 221 std::string* device_id) { |
| 222 |
222 *device_id = base::IntToString(current_device_id_++); | 223 *device_id = base::IntToString(current_device_id_++); |
223 base::SystemMonitor* system_monitor = base::SystemMonitor::Get(); | 224 base::SystemMonitor* system_monitor = base::SystemMonitor::Get(); |
224 system_monitor->ProcessMediaDeviceAttached(*device_id, | 225 system_monitor->ProcessMediaDeviceAttached(*device_id, |
225 UTF8ToUTF16(mount_device), | 226 UTF8ToUTF16(mount_device), |
226 SystemMonitor::TYPE_PATH, | 227 SystemMonitor::TYPE_PATH, |
227 mount_point); | 228 mount_point); |
228 } | 229 } |
229 | 230 |
230 void MediaDeviceNotificationsLinux::RemoveOldDevice( | 231 void MediaDeviceNotificationsLinux::RemoveOldDevice( |
231 const std::string& device_id) { | 232 const std::string& device_id) { |
232 base::SystemMonitor* system_monitor = base::SystemMonitor::Get(); | 233 base::SystemMonitor* system_monitor = base::SystemMonitor::Get(); |
233 system_monitor->ProcessMediaDeviceDetached(device_id); | 234 system_monitor->ProcessMediaDeviceDetached(device_id); |
234 } | 235 } |
235 | 236 |
236 } // namespace chrome | 237 } // namespace chrome |
OLD | NEW |