| 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_DELEGATE_IMPL_LINUX_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_DELEGATE_IMPL_LINUX_H_ |
| 6 #define CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_DELEGATE_IMPL_LINUX_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_DELEGATE_IMPL_LINUX_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 "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h" |
| 15 #include "chrome/browser/media_galleries/mtp_device_delegate_impl.h" | 16 #include "chrome/browser/media_galleries/mtp_device_delegate_impl.h" |
| 16 #include "webkit/fileapi/async_file_util.h" | 17 #include "webkit/fileapi/async_file_util.h" |
| 17 #include "webkit/fileapi/media/mtp_device_async_delegate.h" | |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 class FilePath; | 20 class FilePath; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace chrome { | 23 namespace chrome { |
| 24 | 24 |
| 25 struct SnapshotRequestInfo; | 25 struct SnapshotRequestInfo; |
| 26 | 26 |
| 27 // MTPDeviceDelegateImplLinux communicates with the media transfer protocol | 27 // MTPDeviceDelegateImplLinux communicates with the media transfer protocol |
| 28 // (MTP) device to complete file system operations. These operations are | 28 // (MTP) device to complete file system operations. These operations are |
| 29 // performed asynchronously. Instantiate this class per MTP device storage. | 29 // performed asynchronously. Instantiate this class per MTP device storage. |
| 30 // MTPDeviceDelegateImplLinux lives on the IO thread. | 30 // MTPDeviceDelegateImplLinux lives on the IO thread. |
| 31 // MTPDeviceDelegateImplLinux does a call-and-reply to the UI thread | 31 // MTPDeviceDelegateImplLinux does a call-and-reply to the UI thread |
| 32 // to dispatch the requests to MediaTransferProtocolManager. | 32 // to dispatch the requests to MediaTransferProtocolManager. |
| 33 class MTPDeviceDelegateImplLinux : public fileapi::MTPDeviceAsyncDelegate { | 33 class MTPDeviceDelegateImplLinux : public MTPDeviceAsyncDelegate { |
| 34 private: | 34 private: |
| 35 friend void CreateMTPDeviceAsyncDelegate( | 35 friend void CreateMTPDeviceAsyncDelegate( |
| 36 const std::string&, | 36 const std::string&, |
| 37 const CreateMTPDeviceAsyncDelegateCallback&); | 37 const CreateMTPDeviceAsyncDelegateCallback&); |
| 38 | 38 |
| 39 enum InitializationState { | 39 enum InitializationState { |
| 40 UNINITIALIZED = 0, | 40 UNINITIALIZED = 0, |
| 41 PENDING_INIT, | 41 PENDING_INIT, |
| 42 INITIALIZED | 42 INITIALIZED |
| 43 }; | 43 }; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 191 |
| 192 // For callbacks that may run after destruction. | 192 // For callbacks that may run after destruction. |
| 193 base::WeakPtrFactory<MTPDeviceDelegateImplLinux> weak_ptr_factory_; | 193 base::WeakPtrFactory<MTPDeviceDelegateImplLinux> weak_ptr_factory_; |
| 194 | 194 |
| 195 DISALLOW_COPY_AND_ASSIGN(MTPDeviceDelegateImplLinux); | 195 DISALLOW_COPY_AND_ASSIGN(MTPDeviceDelegateImplLinux); |
| 196 }; | 196 }; |
| 197 | 197 |
| 198 } // namespace chrome | 198 } // namespace chrome |
| 199 | 199 |
| 200 #endif // CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_DELEGATE_IMPL_LINUX_H
_ | 200 #endif // CHROME_BROWSER_MEDIA_GALLERIES_LINUX_MTP_DEVICE_DELEGATE_IMPL_LINUX_H
_ |
| OLD | NEW |