| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_OBJECT_ENUMERATOR_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_OBJECT_ENUMERATOR_H_ |
| 6 #define CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_OBJECT_ENUMERATOR_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_OBJECT_ENUMERATOR_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 12 #include "device/media_transfer_protocol/mtp_file_entry.pb.h" | 12 #include "device/media_transfer_protocol/mtp_file_entry.pb.h" |
| 13 #include "webkit/browser/fileapi/file_system_file_util.h" | 13 #include "webkit/browser/fileapi/file_system_file_util.h" |
| 14 | 14 |
| 15 namespace chrome { | |
| 16 | |
| 17 // Used to enumerate top-level files of an media file system. | 15 // Used to enumerate top-level files of an media file system. |
| 18 class MTPDeviceObjectEnumerator | 16 class MTPDeviceObjectEnumerator |
| 19 : public fileapi::FileSystemFileUtil::AbstractFileEnumerator { | 17 : public fileapi::FileSystemFileUtil::AbstractFileEnumerator { |
| 20 public: | 18 public: |
| 21 explicit MTPDeviceObjectEnumerator(const std::vector<MtpFileEntry>& entries); | 19 explicit MTPDeviceObjectEnumerator(const std::vector<MtpFileEntry>& entries); |
| 22 | 20 |
| 23 virtual ~MTPDeviceObjectEnumerator(); | 21 virtual ~MTPDeviceObjectEnumerator(); |
| 24 | 22 |
| 25 // AbstractFileEnumerator: | 23 // AbstractFileEnumerator: |
| 26 virtual base::FilePath Next() OVERRIDE; | 24 virtual base::FilePath Next() OVERRIDE; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 47 // Index into |file_entries_|. | 45 // Index into |file_entries_|. |
| 48 // Should only be used when |is_index_ready_| is true. | 46 // Should only be used when |is_index_ready_| is true. |
| 49 size_t index_; | 47 size_t index_; |
| 50 | 48 |
| 51 // Initially false. Set to true after Next() has been called. | 49 // Initially false. Set to true after Next() has been called. |
| 52 bool is_index_ready_; | 50 bool is_index_ready_; |
| 53 | 51 |
| 54 DISALLOW_COPY_AND_ASSIGN(MTPDeviceObjectEnumerator); | 52 DISALLOW_COPY_AND_ASSIGN(MTPDeviceObjectEnumerator); |
| 55 }; | 53 }; |
| 56 | 54 |
| 57 } // namespace chrome | |
| 58 | |
| 59 #endif // CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_OBJECT_ENUMERATOR_H_ | 55 #endif // CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_OBJECT_ENUMERATOR_H_ |
| OLD | NEW |