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 #ifndef CHROME_BROWSER_SYSTEM_MONITOR_DISK_INFO_MAC_H_ | 5 #ifndef CHROME_BROWSER_SYSTEM_MONITOR_DISK_INFO_MAC_H_ |
6 #define CHROME_BROWSER_SYSTEM_MONITOR_DISK_INFO_MAC_H_ | 6 #define CHROME_BROWSER_SYSTEM_MONITOR_DISK_INFO_MAC_H_ |
7 | 7 |
8 #include <CoreFoundation/CoreFoundation.h> | 8 #include <CoreFoundation/CoreFoundation.h> |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "chrome/browser/system_monitor/media_storage_util.h" | 11 #include "chrome/browser/system_monitor/media_storage_util.h" |
12 | 12 |
13 namespace chrome { | 13 namespace chrome { |
14 | 14 |
15 // This class stores information about a particular disk. | 15 // This class stores information about a particular disk. |
16 class DiskInfoMac { | 16 class DiskInfoMac { |
17 public: | 17 public: |
18 DiskInfoMac(); | 18 DiskInfoMac(); |
19 ~DiskInfoMac(); | 19 ~DiskInfoMac(); |
20 | 20 |
21 // Creates a disk info object based on information from the given | 21 // Creates a disk info object based on information from the given |
22 // dictionary. This function must be called on the file thread. | 22 // dictionary. This function must be called on the file thread. |
23 static DiskInfoMac BuildDiskInfoOnFileThread(CFDictionaryRef dict); | 23 static DiskInfoMac BuildDiskInfoOnFileThread(CFDictionaryRef dict); |
24 | 24 |
25 // Construct a disk info object from info from an ImageCature device. | |
26 static DiskInfoMac BuildDiskInfoFromICDevice(std::string device_id, | |
sail
2012/12/10 23:06:36
exercise this in unit tests?
Greg Billock
2012/12/11 00:11:22
I'll see about doing this later. I don't think a d
sail
2012/12/11 00:14:01
Could you add a TODO? It would be good to have goo
Greg Billock
2012/12/11 01:02:26
OK. I do think this'll get tested, but I don't thi
sail
2012/12/11 18:40:21
The disk info stuff is exercised in removable_devi
| |
27 string16 device_name, | |
28 FilePath mount_point); | |
29 | |
25 const std::string& bsd_name() const { return bsd_name_; } | 30 const std::string& bsd_name() const { return bsd_name_; } |
26 const std::string& device_id() const { return device_id_; } | 31 const std::string& device_id() const { return device_id_; } |
27 const std::string& model_name() const { return model_name_; } | 32 const std::string& model_name() const { return model_name_; } |
28 const string16& device_name() const { return device_name_; } | 33 const string16& device_name() const { return device_name_; } |
29 const FilePath& mount_point() const { return mount_point_; } | 34 const FilePath& mount_point() const { return mount_point_; } |
30 MediaStorageUtil::Type type() const { return type_; } | 35 MediaStorageUtil::Type type() const { return type_; } |
31 uint64 total_size_in_bytes() const { return total_size_in_bytes_; } | 36 uint64 total_size_in_bytes() const { return total_size_in_bytes_; } |
32 | 37 |
33 private: | 38 private: |
34 std::string bsd_name_; | 39 std::string bsd_name_; |
35 std::string device_id_; | 40 std::string device_id_; |
36 std::string model_name_; | 41 std::string model_name_; |
37 string16 device_name_; | 42 string16 device_name_; |
38 FilePath mount_point_; | 43 FilePath mount_point_; |
39 MediaStorageUtil::Type type_; | 44 MediaStorageUtil::Type type_; |
40 uint64 total_size_in_bytes_; | 45 uint64 total_size_in_bytes_; |
41 }; | 46 }; |
42 | 47 |
43 } // namespace chrome | 48 } // namespace chrome |
44 | 49 |
45 #endif // CHROME_BROWSER_SYSTEM_MONITOR_DISK_INFO_MAC_H_ | 50 #endif // CHROME_BROWSER_SYSTEM_MONITOR_DISK_INFO_MAC_H_ |
OLD | NEW |