Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 // | |
| 5 // This class enumerates the media transfer protocol (MTP) device objects from | |
| 6 // a given object entry list. | |
| 7 | |
| 8 #ifndef CHROME_BROWSER_MEDIA_GALLERY_WIN_MTP_DEVICE_OBJECT_ENUMERATOR_H_ | |
| 9 #define CHROME_BROWSER_MEDIA_GALLERY_WIN_MTP_DEVICE_OBJECT_ENUMERATOR_H_ | |
| 10 | |
| 11 #include "base/file_path.h" | |
| 12 #include "base/threading/thread_checker.h" | |
| 13 #include "base/time.h" | |
| 14 #include "chrome/browser/media_gallery/win/mtp_device_object_entry.h" | |
| 15 #include "webkit/fileapi/file_system_file_util.h" | |
| 16 | |
| 17 namespace chrome { | |
| 18 | |
| 19 // This class enumerates the media transfer protocol device objects. This class | |
| 20 // is mainly used to enumerate top-level files of a media device file system. | |
|
Ryan Sleevi
2013/01/09 00:20:36
"mainly used"? What other uses does it have? How d
kmadhusu
2013/01/09 18:11:14
Rephrased the comment.
| |
| 21 // This class supports MTP device file operations. This class is created, | |
| 22 // destroyed and operated on the blocking pool thread. | |
| 23 class MTPDeviceObjectEnumerator | |
| 24 : public fileapi::FileSystemFileUtil::AbstractFileEnumerator { | |
| 25 public: | |
| 26 explicit MTPDeviceObjectEnumerator(const MTPDeviceObjectEntries& entries); | |
| 27 virtual ~MTPDeviceObjectEnumerator(); | |
| 28 | |
| 29 // AbstractFileEnumerator: | |
| 30 virtual FilePath Next() OVERRIDE; | |
| 31 virtual int64 Size() OVERRIDE; | |
| 32 virtual bool IsDirectory() OVERRIDE; | |
| 33 virtual base::Time LastModifiedTime() OVERRIDE; | |
| 34 | |
| 35 private: | |
| 36 // The directory file object entries. | |
| 37 MTPDeviceObjectEntries object_entries_; | |
| 38 | |
| 39 // Iterator to access the individual file object entries. | |
| 40 MTPDeviceObjectEntries::const_iterator object_entry_iter_; | |
| 41 | |
| 42 // The current file object entry. | |
| 43 MTPDeviceObjectEntry current_object_; | |
| 44 | |
| 45 base::ThreadChecker thread_checker_; | |
| 46 | |
| 47 DISALLOW_COPY_AND_ASSIGN(MTPDeviceObjectEnumerator); | |
| 48 }; | |
| 49 | |
| 50 } // namepsace chrome | |
| 51 | |
| 52 #endif // CHROME_BROWSER_MEDIA_GALLERY_WIN_MTP_DEVICE_OBJECT_ENUMERATOR_H_ | |
| OLD | NEW |