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 // MTPDeviceObjectEnumerator is used to enumerate the media transfer protocol | |
| 20 // (MTP) device objects from a given object entry list. | |
| 21 // MTPDeviceObjectEnumerator supports MTP device file operations. | |
| 22 // MTPDeviceObjectEnumerator is created, destroyed and operated on the blocking | |
| 23 // pool thread. | |
|
Ryan Sleevi
2013/01/09 20:22:25
s/MTPDeviceObjectEnumerator is created, destroyed,
kmadhusu
2013/01/10 04:59:19
Done.
| |
| 24 class MTPDeviceObjectEnumerator | |
| 25 : public fileapi::FileSystemFileUtil::AbstractFileEnumerator { | |
| 26 public: | |
| 27 explicit MTPDeviceObjectEnumerator(const MTPDeviceObjectEntries& entries); | |
| 28 virtual ~MTPDeviceObjectEnumerator(); | |
| 29 | |
| 30 // AbstractFileEnumerator: | |
| 31 virtual FilePath Next() OVERRIDE; | |
| 32 virtual int64 Size() OVERRIDE; | |
| 33 virtual bool IsDirectory() OVERRIDE; | |
| 34 virtual base::Time LastModifiedTime() OVERRIDE; | |
| 35 | |
| 36 private: | |
| 37 // The directory file object entries. | |
| 38 MTPDeviceObjectEntries object_entries_; | |
| 39 | |
| 40 // Iterator to access the individual file object entries. | |
| 41 MTPDeviceObjectEntries::const_iterator object_entry_iter_; | |
| 42 | |
| 43 // The current file object entry. | |
| 44 MTPDeviceObjectEntry current_object_; | |
| 45 | |
| 46 base::ThreadChecker thread_checker_; | |
| 47 | |
| 48 DISALLOW_COPY_AND_ASSIGN(MTPDeviceObjectEnumerator); | |
| 49 }; | |
| 50 | |
| 51 } // namepsace chrome | |
| 52 | |
| 53 #endif // CHROME_BROWSER_MEDIA_GALLERY_WIN_MTP_DEVICE_OBJECT_ENUMERATOR_H_ | |
| OLD | NEW |