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 // chromeos::MediaDeviceNotifications listens for mount point changes and | 5 // chromeos::MediaDeviceNotifications listens for mount point changes and |
6 // notifies the SystemMonitor about the addition and deletion of media devices. | 6 // notifies the SystemMonitor about the addition and deletion of media devices. |
7 | 7 |
8 #ifndef CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_NOTIFICATIONS_CHROMEOS_H_ | 8 #ifndef CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_NOTIFICATIONS_CHROMEOS_H_ |
9 #define CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_NOTIFICATIONS_CHROMEOS_H_ | 9 #define CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_NOTIFICATIONS_CHROMEOS_H_ |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... | |
40 | 40 |
41 private: | 41 private: |
42 friend class base::RefCountedThreadSafe<MediaDeviceNotifications>; | 42 friend class base::RefCountedThreadSafe<MediaDeviceNotifications>; |
43 | 43 |
44 // Mapping of mount points to mount device IDs. | 44 // Mapping of mount points to mount device IDs. |
45 typedef std::map<std::string, std::string> MountMap; | 45 typedef std::map<std::string, std::string> MountMap; |
46 | 46 |
47 // Private to avoid code deleting the object. | 47 // Private to avoid code deleting the object. |
48 virtual ~MediaDeviceNotifications(); | 48 virtual ~MediaDeviceNotifications(); |
49 | 49 |
50 // Checks existing mount points map for media devices. | |
51 void CheckExistingMountPoints(); | |
Lei Zhang
2012/08/03 06:24:19
How about:
// Checks existing mount points map for
kmadhusu
2012/08/03 06:37:02
Done.
| |
52 | |
50 // Checks if the mount point in |mount_info| is a media device. If it is, | 53 // Checks if the mount point in |mount_info| is a media device. If it is, |
51 // then continue with AddMountedPathOnUIThread() below. | 54 // then continue with AddMountedPathOnUIThread() below. |
52 void CheckMountedPathOnFileThread( | 55 void CheckMountedPathOnFileThread( |
53 const disks::DiskMountManager::MountPointInfo& mount_info); | 56 const disks::DiskMountManager::MountPointInfo& mount_info); |
54 | 57 |
55 // Adds the mount point in |mount_info| to |mount_map_| and send a media | 58 // Adds the mount point in |mount_info| to |mount_map_| and send a media |
56 // device attach notification. | 59 // device attach notification. |
57 void AddMountedPathOnUIThread( | 60 void AddMountedPathOnUIThread( |
58 const disks::DiskMountManager::MountPointInfo& mount_info); | 61 const disks::DiskMountManager::MountPointInfo& mount_info); |
59 | 62 |
60 // Mapping of relevant mount points and their corresponding mount devices. | 63 // Mapping of relevant mount points and their corresponding mount devices. |
61 // Only accessed on the UI thread. | 64 // Only accessed on the UI thread. |
62 MountMap mount_map_; | 65 MountMap mount_map_; |
63 | 66 |
64 DISALLOW_COPY_AND_ASSIGN(MediaDeviceNotifications); | 67 DISALLOW_COPY_AND_ASSIGN(MediaDeviceNotifications); |
65 }; | 68 }; |
66 | 69 |
67 } // namespace chromeos | 70 } // namespace chromeos |
68 | 71 |
69 #endif // CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_NOTIFICATIONS_CHROMEOS_H_ | 72 #endif // CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_NOTIFICATIONS_CHROMEOS_H_ |
OLD | NEW |