Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9013)

Unified Diff: chrome/browser/media_gallery/win/mtp_device_object_enumerator.h

Issue 11297002: [Media Gallery] Added code to support mtp device media file system on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media_gallery/win/mtp_device_object_enumerator.h
diff --git a/chrome/browser/media_gallery/win/mtp_device_object_enumerator.h b/chrome/browser/media_gallery/win/mtp_device_object_enumerator.h
new file mode 100644
index 0000000000000000000000000000000000000000..7fb077f33e044d53258862bb9b3b6bd3b2b34102
--- /dev/null
+++ b/chrome/browser/media_gallery/win/mtp_device_object_enumerator.h
@@ -0,0 +1,52 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// This class enumerates the media transfer protocol (MTP) device objects from
+// a given object entry list. This class is mainly used to enumerate top-level
+// files of a media device file system. This class supports MTP device file
+// operations. This class is created, destroyed and operated on the blocking
+// thread.
Peter Kasting 2012/12/19 20:17:58 Nit: thread -> pool thread
kmadhusu 2012/12/20 20:37:29 Done.
+
+#ifndef CHROME_BROWSER_MEDIA_GALLERY_WIN_MTP_DEVICE_OBJECT_ENUMERATOR_H_
+#define CHROME_BROWSER_MEDIA_GALLERY_WIN_MTP_DEVICE_OBJECT_ENUMERATOR_H_
+
+#include "base/file_path.h"
+#include "base/threading/thread_checker.h"
+#include "base/time.h"
+#include "chrome/browser/media_gallery/win/mtp_device_object_entry.h"
+#include "webkit/fileapi/file_system_file_util.h"
+
+namespace chrome {
+
+// This class enumerates the media transfer protocol device objects.
+class MTPDeviceObjectEnumerator
+ : public fileapi::FileSystemFileUtil::AbstractFileEnumerator {
+ public:
+ explicit MTPDeviceObjectEnumerator(const MTPDeviceObjectEntries& entries);
+ virtual ~MTPDeviceObjectEnumerator();
+
+ // AbstractFileEnumerator:
+ virtual FilePath Next() OVERRIDE;
+ virtual int64 Size() OVERRIDE;
+ virtual bool IsDirectory() OVERRIDE;
+ virtual base::Time LastModifiedTime() OVERRIDE;
+
+ private:
+ // The directory file object entries.
+ MTPDeviceObjectEntries object_entries_;
+
+ // Iterator to access the individual file object entries.
+ MTPDeviceObjectEntries::const_iterator object_entry_iter_;
+
+ // The current file object entry.
+ MTPDeviceObjectEntry current_object_;
+
+ base::ThreadChecker thread_checker_;
+
+ DISALLOW_COPY_AND_ASSIGN(MTPDeviceObjectEnumerator);
+};
+
+} // namepsace chrome
+
+#endif // CHROME_BROWSER_MEDIA_GALLERY_WIN_MTP_DEVICE_OBJECT_ENUMERATOR_H_

Powered by Google App Engine
This is Rietveld 408576698