| 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_MTP_DEVICE_DELEGATE_IMPL_MAC_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_MTP_DEVICE_DELEGATE_IMPL_MAC_H_ |
| 6 #define CHROME_BROWSER_MEDIA_GALLERIES_MTP_DEVICE_DELEGATE_IMPL_MAC_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERIES_MTP_DEVICE_DELEGATE_IMPL_MAC_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/hash_tables.h" | 13 #include "base/hash_tables.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/platform_file.h" | 15 #include "base/platform_file.h" |
| 16 #include "webkit/fileapi/media/mtp_device_async_delegate.h" | 16 #include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h" |
| 17 | 17 |
| 18 namespace chrome { | 18 namespace chrome { |
| 19 | 19 |
| 20 // Delegate for presenting an Image Capture device through the filesystem | 20 // Delegate for presenting an Image Capture device through the filesystem |
| 21 // API. The synthetic filesystem will be rooted at the constructed location, | 21 // API. The synthetic filesystem will be rooted at the constructed location, |
| 22 // and names of all files notified through the ItemAdded call will be | 22 // and names of all files notified through the ItemAdded call will be |
| 23 // all appear as children of that directory. (ItemAdded calls with directories | 23 // all appear as children of that directory. (ItemAdded calls with directories |
| 24 // will be ignored.) | 24 // will be ignored.) |
| 25 // Note on thread management: This class is thread-compatible: it can be created | 25 // Note on thread management: This class is thread-compatible: it can be created |
| 26 // on any thread, but then mutates all state on the UI thread. The async | 26 // on any thread, but then mutates all state on the UI thread. The async |
| 27 // delegate interface can be invoked on any thread, as it simply forwards calls | 27 // delegate interface can be invoked on any thread, as it simply forwards calls |
| 28 // to the UI thread. | 28 // to the UI thread. |
| 29 class MTPDeviceDelegateImplMac : public fileapi::MTPDeviceAsyncDelegate { | 29 class MTPDeviceDelegateImplMac : public MTPDeviceAsyncDelegate { |
| 30 public: | 30 public: |
| 31 MTPDeviceDelegateImplMac(const std::string& device_id, | 31 MTPDeviceDelegateImplMac(const std::string& device_id, |
| 32 const base::FilePath::StringType& synthetic_path); | 32 const base::FilePath::StringType& synthetic_path); |
| 33 | 33 |
| 34 // MTPDeviceAsyncDelegate implementation. These functions are called on the | 34 // MTPDeviceAsyncDelegate implementation. These functions are called on the |
| 35 // IO thread by the async filesystem file util. They forward to | 35 // IO thread by the async filesystem file util. They forward to |
| 36 // similarly-named methods on the UI thread. | 36 // similarly-named methods on the UI thread. |
| 37 virtual void GetFileInfo( | 37 virtual void GetFileInfo( |
| 38 const base::FilePath& file_path, | 38 const base::FilePath& file_path, |
| 39 const GetFileInfoSuccessCallback& success_callback, | 39 const GetFileInfoSuccessCallback& success_callback, |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 ReadDirTransactionList read_dir_transactions_; | 133 ReadDirTransactionList read_dir_transactions_; |
| 134 | 134 |
| 135 base::WeakPtrFactory<MTPDeviceDelegateImplMac> weak_factory_; | 135 base::WeakPtrFactory<MTPDeviceDelegateImplMac> weak_factory_; |
| 136 | 136 |
| 137 DISALLOW_COPY_AND_ASSIGN(MTPDeviceDelegateImplMac); | 137 DISALLOW_COPY_AND_ASSIGN(MTPDeviceDelegateImplMac); |
| 138 }; | 138 }; |
| 139 | 139 |
| 140 } // namespace chrome | 140 } // namespace chrome |
| 141 | 141 |
| 142 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MTP_DEVICE_DELEGATE_IMPL_MAC_H_ | 142 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MTP_DEVICE_DELEGATE_IMPL_MAC_H_ |
| OLD | NEW |