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

Side by Side Diff: chrome/browser/media_gallery/win/recursive_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: Fixed class comments and removed file comments Created 7 years, 11 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 #ifndef CHROME_BROWSER_MEDIA_GALLERY_WIN_RECURSIVE_MTP_DEVICE_OBJECT_ENUMERATOR_ H_
6 #define CHROME_BROWSER_MEDIA_GALLERY_WIN_RECURSIVE_MTP_DEVICE_OBJECT_ENUMERATOR_ H_
7
8 #include <portabledeviceapi.h>
9 #include <vector>
10
11 #include "base/memory/scoped_ptr.h"
12 #include "base/threading/thread_checker.h"
13 #include "base/time.h"
14 #include "base/win/scoped_comptr.h"
15 #include "chrome/browser/media_gallery/win/mtp_device_object_entry.h"
16 #include "webkit/fileapi/file_system_file_util.h"
17
18 class FilePath;
19
20 namespace chrome {
21
22 // RecursiveMTPDeviceObjectEnumerator is used to recursively enumerate the
23 // media transfer protocol (MTP) device storage objects from a given media file
24 // object entries set. RecursiveMTPDeviceObjectEnumerator communicates with the
25 // MTP device to get the removable storage objects details.
26 // RecursiveMTPDeviceObjectEnumerator supports media file system operations.
27 // RecursiveMTPDeviceObjectEnumerator is created, destroyed and operated on the
28 // blocking pool thread. MTP device is already opened for communication.
29 class RecursiveMTPDeviceObjectEnumerator
30 : public fileapi::FileSystemFileUtil::AbstractFileEnumerator {
31 public:
32 RecursiveMTPDeviceObjectEnumerator(IPortableDevice* device,
33 const MTPDeviceObjectEntries& entries);
34 virtual ~RecursiveMTPDeviceObjectEnumerator();
35
36 // AbstractFileEnumerator:
37 virtual FilePath Next() OVERRIDE;
38 virtual int64 Size() OVERRIDE;
39 virtual bool IsDirectory() OVERRIDE;
40 virtual base::Time LastModifiedTime() OVERRIDE;
41
42 private:
43 // The portable device.
44 base::win::ScopedComPtr<IPortableDevice> device_;
45
46 // List of top-level directory object entries.
47 const MTPDeviceObjectEntries object_entries_;
48
49 // Iterator to access the individual file object entries.
50 MTPDeviceObjectEntries::const_iterator object_entry_iter_;
51
52 // Enumerator to access current directory object entries.
53 scoped_ptr<fileapi::FileSystemFileUtil::AbstractFileEnumerator>
54 current_enumerator_;
55
56 base::ThreadChecker thread_checker_;
57
58 DISALLOW_COPY_AND_ASSIGN(RecursiveMTPDeviceObjectEnumerator);
59 };
60
61 } // namespace chrome
62
63 #endif // CHROME_BROWSER_MEDIA_GALLERY_WIN_RECURSIVE_MTP_DEVICE_OBJECT_ENUMERAT OR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698