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

Side by Side Diff: chrome/browser/system_monitor/removable_device_notifications_chromeos.h

Issue 11363236: Revert 167606 - [Media Gallery][ChromeOS] Improve device media gallery names. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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::RemovableDeviceNotificationsCros listens for mount point changes 5 // chromeos::RemovableDeviceNotificationsCros listens for mount point changes
6 // and notifies the SystemMonitor about the addition and deletion of media 6 // and notifies the SystemMonitor about the addition and deletion of media
7 // devices. 7 // devices.
8 8
9 #ifndef CHROME_BROWSER_SYSTEM_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_CHROMEOS_H_ 9 #ifndef CHROME_BROWSER_SYSTEM_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_CHROMEOS_H_
10 #define CHROME_BROWSER_SYSTEM_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_CHROMEOS_H_ 10 #define CHROME_BROWSER_SYSTEM_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_CHROMEOS_H_
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 disks::DiskMountManager::MountEvent event_type, 53 disks::DiskMountManager::MountEvent event_type,
54 MountError error_code, 54 MountError error_code,
55 const disks::DiskMountManager::MountPointInfo& mount_info) OVERRIDE; 55 const disks::DiskMountManager::MountPointInfo& mount_info) OVERRIDE;
56 56
57 // Finds the device that contains |path| and populates |device_info|. 57 // Finds the device that contains |path| and populates |device_info|.
58 // Returns false if unable to find the device. 58 // Returns false if unable to find the device.
59 bool GetDeviceInfoForPath( 59 bool GetDeviceInfoForPath(
60 const FilePath& path, 60 const FilePath& path,
61 base::SystemMonitor::RemovableStorageInfo* device_info) const; 61 base::SystemMonitor::RemovableStorageInfo* device_info) const;
62 62
63 // Returns the storage size of the device present at |location|. If the
64 // device information is unavailable, returns zero.
65 uint64 GetStorageSize(const std::string& location) const;
66
67 private: 63 private:
68 struct StorageObjectInfo {
69 // Basic details {storage device name, location and identifier}.
70 base::SystemMonitor::RemovableStorageInfo storage_info;
71
72 // Device storage size.
73 uint64 storage_size_in_bytes;
74 };
75
76 friend class base::RefCountedThreadSafe<RemovableDeviceNotificationsCros>; 64 friend class base::RefCountedThreadSafe<RemovableDeviceNotificationsCros>;
77 65
78 // Mapping of mount path to removable mass storage info. 66 // Mapping of mount path to removable mass storage info.
79 typedef std::map<std::string, StorageObjectInfo> MountMap; 67 typedef std::map<std::string, base::SystemMonitor::RemovableStorageInfo>
68 MountMap;
80 69
81 // Private to avoid code deleting the object. 70 // Private to avoid code deleting the object.
82 virtual ~RemovableDeviceNotificationsCros(); 71 virtual ~RemovableDeviceNotificationsCros();
83 72
84 // Checks existing mount points map for media devices. For each mount point, 73 // Checks existing mount points map for media devices. For each mount point,
85 // call CheckMountedPathOnFileThread() below. 74 // call CheckMountedPathOnFileThread() below.
86 void CheckExistingMountPointsOnUIThread(); 75 void CheckExistingMountPointsOnUIThread();
87 76
88 // Checks if the mount point in |mount_info| is a media device. If it is, 77 // Checks if the mount point in |mount_info| is a media device. If it is,
89 // then continue with AddMountedPathOnUIThread() below. 78 // then continue with AddMountedPathOnUIThread() below.
(...skipping 10 matching lines...) Expand all
100 // Mapping of relevant mount points and their corresponding mount devices. 89 // Mapping of relevant mount points and their corresponding mount devices.
101 // Only accessed on the UI thread. 90 // Only accessed on the UI thread.
102 MountMap mount_map_; 91 MountMap mount_map_;
103 92
104 DISALLOW_COPY_AND_ASSIGN(RemovableDeviceNotificationsCros); 93 DISALLOW_COPY_AND_ASSIGN(RemovableDeviceNotificationsCros);
105 }; 94 };
106 95
107 } // namespace chromeos 96 } // namespace chromeos
108 97
109 #endif // CHROME_BROWSER_SYSTEM_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_CHROMEOS _H_ 98 #endif // CHROME_BROWSER_SYSTEM_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_CHROMEOS _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698