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 |
11 #include <set> | 11 #include <set> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/callback_forward.h" | 15 #include "base/callback_forward.h" |
16 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
17 | 17 |
18 struct StorageInfo; | 18 class StorageInfo; |
19 | 19 |
20 class MediaStorageUtil { | 20 class MediaStorageUtil { |
21 public: | 21 public: |
22 typedef std::set<std::string /*device id*/> DeviceIdSet; | 22 typedef std::set<std::string /*device id*/> DeviceIdSet; |
23 | 23 |
24 // Check if the file system at the passed mount point looks like a media | 24 // Check if the file system at the passed mount point looks like a media |
25 // device using the existence of DCIM directory. | 25 // device using the existence of DCIM directory. |
26 // Returns true if it looks like a media device, otherwise returns false. | 26 // Returns true if it looks like a media device, otherwise returns false. |
27 // Mac OS X behaves similarly, but this is not the only heuristic it uses. | 27 // Mac OS X behaves similarly, but this is not the only heuristic it uses. |
28 // TODO(vandebo) Try to figure out how Mac OS X decides this, and rename | 28 // TODO(vandebo) Try to figure out how Mac OS X decides this, and rename |
(...skipping 28 matching lines...) Expand all Loading... |
57 | 57 |
58 // Returns true if the |id| is both a removable device and also | 58 // Returns true if the |id| is both a removable device and also |
59 // currently attached. | 59 // currently attached. |
60 static bool IsRemovableStorageAttached(const std::string& id); | 60 static bool IsRemovableStorageAttached(const std::string& id); |
61 | 61 |
62 private: | 62 private: |
63 DISALLOW_IMPLICIT_CONSTRUCTORS(MediaStorageUtil); | 63 DISALLOW_IMPLICIT_CONSTRUCTORS(MediaStorageUtil); |
64 }; | 64 }; |
65 | 65 |
66 #endif // COMPONENTS_STORAGE_MONITOR_MEDIA_STORAGE_UTIL_H_ | 66 #endif // COMPONENTS_STORAGE_MONITOR_MEDIA_STORAGE_UTIL_H_ |
OLD | NEW |