OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // MediaStorageUtil provides information about storage devices attached | 5 // MediaStorageUtil provides information about storage devices attached |
6 // to the computer. | 6 // to the computer. |
7 | 7 |
8 #ifndef COMPONENTS_STORAGE_MONITOR_MEDIA_STORAGE_UTIL_H_ | 8 #ifndef COMPONENTS_STORAGE_MONITOR_MEDIA_STORAGE_UTIL_H_ |
9 #define COMPONENTS_STORAGE_MONITOR_MEDIA_STORAGE_UTIL_H_ | 9 #define COMPONENTS_STORAGE_MONITOR_MEDIA_STORAGE_UTIL_H_ |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // (from the root of the device). | 43 // (from the root of the device). |
44 static bool GetDeviceInfoFromPath(const base::FilePath& path, | 44 static bool GetDeviceInfoFromPath(const base::FilePath& path, |
45 StorageInfo* device_info, | 45 StorageInfo* device_info, |
46 base::FilePath* relative_path); | 46 base::FilePath* relative_path); |
47 | 47 |
48 // Get a base::FilePath for the given |device_id|. If the device isn't a mass | 48 // Get a base::FilePath for the given |device_id|. If the device isn't a mass |
49 // storage type, the base::FilePath will be empty. This does not check that | 49 // storage type, the base::FilePath will be empty. This does not check that |
50 // the device is connected. | 50 // the device is connected. |
51 static base::FilePath FindDevicePathById(const std::string& device_id); | 51 static base::FilePath FindDevicePathById(const std::string& device_id); |
52 | 52 |
53 // Record device information histogram for the given |device_uuid| and | |
54 // |device_label|. |mass_storage| indicates whether the current device is a | |
55 // mass storage device, as defined by IsMassStorageDevice(). | |
56 static void RecordDeviceInfoHistogram(bool mass_storage, | |
57 const std::string& device_uuid, | |
58 const base::string16& device_label); | |
59 | |
60 // Returns true if the |id| is both a removable device and also | 53 // Returns true if the |id| is both a removable device and also |
61 // currently attached. | 54 // currently attached. |
62 static bool IsRemovableStorageAttached(const std::string& id); | 55 static bool IsRemovableStorageAttached(const std::string& id); |
63 | 56 |
64 private: | 57 private: |
65 DISALLOW_IMPLICIT_CONSTRUCTORS(MediaStorageUtil); | 58 DISALLOW_IMPLICIT_CONSTRUCTORS(MediaStorageUtil); |
66 }; | 59 }; |
67 | 60 |
68 } // namespace storage_monitor | 61 } // namespace storage_monitor |
69 | 62 |
70 #endif // COMPONENTS_STORAGE_MONITOR_MEDIA_STORAGE_UTIL_H_ | 63 #endif // COMPONENTS_STORAGE_MONITOR_MEDIA_STORAGE_UTIL_H_ |
OLD | NEW |