| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_WIN_MTP_DEVICE_DELEGATE_IMPL_WIN_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_DELEGATE_IMPL_WIN_H_ |
| 6 #define CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_DELEGATE_IMPL_WIN_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_DELEGATE_IMPL_WIN_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/location.h" | 11 #include "base/location.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/platform_file.h" | 14 #include "base/platform_file.h" |
| 15 #include "base/string16.h" | 15 #include "base/string16.h" |
| 16 #include "base/win/scoped_comptr.h" | 16 #include "base/win/scoped_comptr.h" |
| 17 #include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h" |
| 17 #include "chrome/browser/media_galleries/mtp_device_delegate_impl.h" | 18 #include "chrome/browser/media_galleries/mtp_device_delegate_impl.h" |
| 18 #include "webkit/fileapi/async_file_util.h" | 19 #include "webkit/fileapi/async_file_util.h" |
| 19 #include "webkit/fileapi/media/mtp_device_async_delegate.h" | |
| 20 | 20 |
| 21 namespace base { | 21 namespace base { |
| 22 class FilePath; | 22 class FilePath; |
| 23 class SequencedTaskRunner; | 23 class SequencedTaskRunner; |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace chrome { | 26 namespace chrome { |
| 27 | 27 |
| 28 class SnapshotFileDetails; | 28 class SnapshotFileDetails; |
| 29 struct SnapshotRequestInfo; | 29 struct SnapshotRequestInfo; |
| 30 | 30 |
| 31 // MTPDeviceDelegateImplWin is used to communicate with the media transfer | 31 // MTPDeviceDelegateImplWin is used to communicate with the media transfer |
| 32 // protocol (MTP) device to complete file system operations. These operations | 32 // protocol (MTP) device to complete file system operations. These operations |
| 33 // are performed asynchronously on a blocking pool thread since the device | 33 // are performed asynchronously on a blocking pool thread since the device |
| 34 // access may be slow and may take a long time to complete. MTP | 34 // access may be slow and may take a long time to complete. MTP |
| 35 // device can have multiple data storage partitions. MTPDeviceDelegateImplWin | 35 // device can have multiple data storage partitions. MTPDeviceDelegateImplWin |
| 36 // is instantiated per MTP device storage partition using | 36 // is instantiated per MTP device storage partition using |
| 37 // CreateMTPDeviceAsyncDelegate(). MTPDeviceDelegateImplWin lives on the IO | 37 // CreateMTPDeviceAsyncDelegate(). MTPDeviceDelegateImplWin lives on the IO |
| 38 // thread. | 38 // thread. |
| 39 class MTPDeviceDelegateImplWin : public fileapi::MTPDeviceAsyncDelegate { | 39 class MTPDeviceDelegateImplWin : public MTPDeviceAsyncDelegate { |
| 40 public: | 40 public: |
| 41 // Structure used to represent MTP device storage partition details. | 41 // Structure used to represent MTP device storage partition details. |
| 42 struct StorageDeviceInfo { | 42 struct StorageDeviceInfo { |
| 43 StorageDeviceInfo(const string16& pnp_device_id, | 43 StorageDeviceInfo(const string16& pnp_device_id, |
| 44 const string16& registered_device_path, | 44 const string16& registered_device_path, |
| 45 const string16& storage_object_id); | 45 const string16& storage_object_id); |
| 46 | 46 |
| 47 // The PnP Device Id, used to open the device for communication, | 47 // The PnP Device Id, used to open the device for communication, |
| 48 // e.g. "\\?\usb#vid_04a9&pid_3073#12#{6ac27878-a6fa-4155-ba85-f1d4f33}". | 48 // e.g. "\\?\usb#vid_04a9&pid_3073#12#{6ac27878-a6fa-4155-ba85-f1d4f33}". |
| 49 const string16 pnp_device_id; | 49 const string16 pnp_device_id; |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 | 212 |
| 213 // For callbacks that may run after destruction. | 213 // For callbacks that may run after destruction. |
| 214 base::WeakPtrFactory<MTPDeviceDelegateImplWin> weak_ptr_factory_; | 214 base::WeakPtrFactory<MTPDeviceDelegateImplWin> weak_ptr_factory_; |
| 215 | 215 |
| 216 DISALLOW_COPY_AND_ASSIGN(MTPDeviceDelegateImplWin); | 216 DISALLOW_COPY_AND_ASSIGN(MTPDeviceDelegateImplWin); |
| 217 }; | 217 }; |
| 218 | 218 |
| 219 } // namespace chrome | 219 } // namespace chrome |
| 220 | 220 |
| 221 #endif // CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_DELEGATE_IMPL_WIN_H_ | 221 #endif // CHROME_BROWSER_MEDIA_GALLERIES_WIN_MTP_DEVICE_DELEGATE_IMPL_WIN_H_ |
| OLD | NEW |