| 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 #include "chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.h" | 5 #include "chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 8 |
| 7 #include <algorithm> | 9 #include <algorithm> |
| 8 | 10 |
| 9 #include "base/mac/scoped_nsobject.h" | 11 #include "base/mac/scoped_nsobject.h" |
| 12 #include "base/macros.h" |
| 10 #include "base/threading/sequenced_worker_pool.h" | 13 #include "base/threading/sequenced_worker_pool.h" |
| 11 #include "components/storage_monitor/image_capture_device.h" | 14 #include "components/storage_monitor/image_capture_device.h" |
| 12 #include "components/storage_monitor/image_capture_device_manager.h" | 15 #include "components/storage_monitor/image_capture_device_manager.h" |
| 13 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
| 14 #include "storage/browser/fileapi/async_file_util.h" | 17 #include "storage/browser/fileapi/async_file_util.h" |
| 15 | 18 |
| 16 namespace { | 19 namespace { |
| 17 | 20 |
| 18 int kReadDirectoryTimeLimitSeconds = 20; | 21 int kReadDirectoryTimeLimitSeconds = 20; |
| 19 | 22 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 success_callback, error_callback)); | 207 success_callback, error_callback)); |
| 205 } | 208 } |
| 206 | 209 |
| 207 bool MTPDeviceDelegateImplMac::IsStreaming() { | 210 bool MTPDeviceDelegateImplMac::IsStreaming() { |
| 208 return false; | 211 return false; |
| 209 } | 212 } |
| 210 | 213 |
| 211 void MTPDeviceDelegateImplMac::ReadBytes( | 214 void MTPDeviceDelegateImplMac::ReadBytes( |
| 212 const base::FilePath& device_file_path, | 215 const base::FilePath& device_file_path, |
| 213 const scoped_refptr<net::IOBuffer>& buf, | 216 const scoped_refptr<net::IOBuffer>& buf, |
| 214 int64 offset, | 217 int64_t offset, |
| 215 int buf_len, | 218 int buf_len, |
| 216 const ReadBytesSuccessCallback& success_callback, | 219 const ReadBytesSuccessCallback& success_callback, |
| 217 const ErrorCallback& error_callback) { | 220 const ErrorCallback& error_callback) { |
| 218 NOTREACHED(); | 221 NOTREACHED(); |
| 219 } | 222 } |
| 220 | 223 |
| 221 bool MTPDeviceDelegateImplMac::IsReadOnly() const { | 224 bool MTPDeviceDelegateImplMac::IsReadOnly() const { |
| 222 return true; | 225 return true; |
| 223 } | 226 } |
| 224 | 227 |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 std::string device_name = base::FilePath(device_location).BaseName().value(); | 563 std::string device_name = base::FilePath(device_location).BaseName().value(); |
| 561 std::string device_id; | 564 std::string device_id; |
| 562 storage_monitor::StorageInfo::Type type; | 565 storage_monitor::StorageInfo::Type type; |
| 563 bool cracked = storage_monitor::StorageInfo::CrackDeviceId( | 566 bool cracked = storage_monitor::StorageInfo::CrackDeviceId( |
| 564 device_name, &type, &device_id); | 567 device_name, &type, &device_id); |
| 565 DCHECK(cracked); | 568 DCHECK(cracked); |
| 566 DCHECK_EQ(storage_monitor::StorageInfo::MAC_IMAGE_CAPTURE, type); | 569 DCHECK_EQ(storage_monitor::StorageInfo::MAC_IMAGE_CAPTURE, type); |
| 567 | 570 |
| 568 cb.Run(new MTPDeviceDelegateImplMac(device_id, device_location)); | 571 cb.Run(new MTPDeviceDelegateImplMac(device_id, device_location)); |
| 569 } | 572 } |
| OLD | NEW |