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, | |
27 string16 device_name, | |
28 FilePath mount_point); | |
29 | |
30 const std::string& bsd_name() const { return bsd_name_; } | 25 const std::string& bsd_name() const { return bsd_name_; } |
31 const std::string& device_id() const { return device_id_; } | 26 const std::string& device_id() const { return device_id_; } |
32 const std::string& model_name() const { return model_name_; } | 27 const std::string& model_name() const { return model_name_; } |
33 const string16& device_name() const { return device_name_; } | 28 const string16& device_name() const { return device_name_; } |
34 const FilePath& mount_point() const { return mount_point_; } | 29 const FilePath& mount_point() const { return mount_point_; } |
35 MediaStorageUtil::Type type() const { return type_; } | 30 MediaStorageUtil::Type type() const { return type_; } |
36 uint64 total_size_in_bytes() const { return total_size_in_bytes_; } | 31 uint64 total_size_in_bytes() const { return total_size_in_bytes_; } |
37 | 32 |
38 private: | 33 private: |
39 std::string bsd_name_; | 34 std::string bsd_name_; |
40 std::string device_id_; | 35 std::string device_id_; |
41 std::string model_name_; | 36 std::string model_name_; |
42 string16 device_name_; | 37 string16 device_name_; |
43 FilePath mount_point_; | 38 FilePath mount_point_; |
44 MediaStorageUtil::Type type_; | 39 MediaStorageUtil::Type type_; |
45 uint64 total_size_in_bytes_; | 40 uint64 total_size_in_bytes_; |
46 }; | 41 }; |
47 | 42 |
48 } // namespace chrome | 43 } // namespace chrome |
49 | 44 |
50 #endif // CHROME_BROWSER_SYSTEM_MONITOR_DISK_INFO_MAC_H_ | 45 #endif // CHROME_BROWSER_SYSTEM_MONITOR_DISK_INFO_MAC_H_ |
OLD | NEW |