OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 // This class enumerates the media transfer protocol (MTP) device objects from | 5 // This class enumerates the media transfer protocol (MTP) device objects from |
6 // a given object entry list. | 6 // a given object entry list. |
7 | 7 |
8 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_OBJECT_ENUMERATOR_H_ | 8 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_OBJECT_ENUMERATOR_H_ |
9 #define CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_OBJECT_ENUMERATOR_H_ | 9 #define CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_OBJECT_ENUMERATOR_H_ |
10 | 10 |
| 11 #include <stddef.h> |
| 12 #include <stdint.h> |
| 13 |
11 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/macros.h" |
12 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
13 #include "base/time/time.h" | 17 #include "base/time/time.h" |
14 #include "chrome/browser/media_galleries/win/mtp_device_object_entry.h" | 18 #include "chrome/browser/media_galleries/win/mtp_device_object_entry.h" |
15 | 19 |
16 // MTPDeviceObjectEnumerator is used to enumerate the media transfer protocol | 20 // MTPDeviceObjectEnumerator is used to enumerate the media transfer protocol |
17 // (MTP) device objects from a given object entry list. | 21 // (MTP) device objects from a given object entry list. |
18 // MTPDeviceObjectEnumerator supports MTP device file operations. | 22 // MTPDeviceObjectEnumerator supports MTP device file operations. |
19 // MTPDeviceObjectEnumerator may only be used on a single thread. | 23 // MTPDeviceObjectEnumerator may only be used on a single thread. |
20 class MTPDeviceObjectEnumerator { | 24 class MTPDeviceObjectEnumerator { |
21 public: | 25 public: |
22 explicit MTPDeviceObjectEnumerator(const MTPDeviceObjectEntries& entries); | 26 explicit MTPDeviceObjectEnumerator(const MTPDeviceObjectEntries& entries); |
23 ~MTPDeviceObjectEnumerator(); | 27 ~MTPDeviceObjectEnumerator(); |
24 | 28 |
25 base::FilePath Next(); | 29 base::FilePath Next(); |
26 int64 Size(); | 30 int64_t Size(); |
27 bool IsDirectory(); | 31 bool IsDirectory(); |
28 base::Time LastModifiedTime(); | 32 base::Time LastModifiedTime(); |
29 | 33 |
30 // If the current file object entry is valid, returns an non-empty object id. | 34 // If the current file object entry is valid, returns an non-empty object id. |
31 // Returns an empty string otherwise. | 35 // Returns an empty string otherwise. |
32 base::string16 GetObjectId() const; | 36 base::string16 GetObjectId() const; |
33 | 37 |
34 private: | 38 private: |
35 // Returns true if the enumerator has more entries to traverse, false | 39 // Returns true if the enumerator has more entries to traverse, false |
36 // otherwise. | 40 // otherwise. |
(...skipping 12 matching lines...) Expand all Loading... |
49 | 53 |
50 // Initially false. Set to true after Next() has been called. | 54 // Initially false. Set to true after Next() has been called. |
51 bool is_index_ready_; | 55 bool is_index_ready_; |
52 | 56 |
53 base::ThreadChecker thread_checker_; | 57 base::ThreadChecker thread_checker_; |
54 | 58 |
55 DISALLOW_COPY_AND_ASSIGN(MTPDeviceObjectEnumerator); | 59 DISALLOW_COPY_AND_ASSIGN(MTPDeviceObjectEnumerator); |
56 }; | 60 }; |
57 | 61 |
58 #endif // CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_OBJECT_ENUMERATOR_H_ | 62 #endif // CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_OBJECT_ENUMERATOR_H_ |
OLD | NEW |