| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
| 10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 void MTPDeviceDelegateImplMac::ReadBytes( | 202 void MTPDeviceDelegateImplMac::ReadBytes( |
| 203 const base::FilePath& device_file_path, | 203 const base::FilePath& device_file_path, |
| 204 const scoped_refptr<net::IOBuffer>& buf, | 204 const scoped_refptr<net::IOBuffer>& buf, |
| 205 int64 offset, | 205 int64 offset, |
| 206 int buf_len, | 206 int buf_len, |
| 207 const ReadBytesSuccessCallback& success_callback, | 207 const ReadBytesSuccessCallback& success_callback, |
| 208 const ErrorCallback& error_callback) { | 208 const ErrorCallback& error_callback) { |
| 209 NOTREACHED(); | 209 NOTREACHED(); |
| 210 } | 210 } |
| 211 | 211 |
| 212 bool MTPDeviceDelegateImplMac::IsReadOnly() { | 212 bool MTPDeviceDelegateImplMac::IsReadOnly() const { |
| 213 return true; | 213 return true; |
| 214 } | 214 } |
| 215 | 215 |
| 216 void MTPDeviceDelegateImplMac::CopyFileFromLocal( | 216 void MTPDeviceDelegateImplMac::CopyFileFromLocal( |
| 217 const base::FilePath& source_file_path, | 217 const base::FilePath& source_file_path, |
| 218 const base::FilePath& device_file_path, | 218 const base::FilePath& device_file_path, |
| 219 const CopyFileFromLocalSuccessCallback& success_callback, | 219 const CopyFileFromLocalSuccessCallback& success_callback, |
| 220 const ErrorCallback& error_callback) { | 220 const ErrorCallback& error_callback) { |
| 221 NOTREACHED(); | 221 NOTREACHED(); |
| 222 } | 222 } |
| 223 | 223 |
| 224 void MTPDeviceDelegateImplMac::DeleteFile( |
| 225 const base::FilePath& file_path, |
| 226 const DeleteFileSuccessCallback& success_callback, |
| 227 const ErrorCallback& error_callback) { |
| 228 NOTREACHED(); |
| 229 } |
| 230 |
| 231 void MTPDeviceDelegateImplMac::DeleteDirectory( |
| 232 const base::FilePath& file_path, |
| 233 const DeleteDirectorySuccessCallback& success_callback, |
| 234 const ErrorCallback& error_callback) { |
| 235 NOTREACHED(); |
| 236 } |
| 237 |
| 224 void MTPDeviceDelegateImplMac::CancelPendingTasksAndDeleteDelegate() { | 238 void MTPDeviceDelegateImplMac::CancelPendingTasksAndDeleteDelegate() { |
| 225 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, | 239 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, |
| 226 base::Bind(&MTPDeviceDelegateImplMac::CancelAndDelete, | 240 base::Bind(&MTPDeviceDelegateImplMac::CancelAndDelete, |
| 227 base::Unretained(this))); | 241 base::Unretained(this))); |
| 228 } | 242 } |
| 229 | 243 |
| 230 void MTPDeviceDelegateImplMac::GetFileInfoImpl( | 244 void MTPDeviceDelegateImplMac::GetFileInfoImpl( |
| 231 const base::FilePath& file_path, | 245 const base::FilePath& file_path, |
| 232 base::File::Info* file_info, | 246 base::File::Info* file_info, |
| 233 base::File::Error* error) { | 247 base::File::Error* error) { |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 std::string device_name = base::FilePath(device_location).BaseName().value(); | 514 std::string device_name = base::FilePath(device_location).BaseName().value(); |
| 501 std::string device_id; | 515 std::string device_id; |
| 502 storage_monitor::StorageInfo::Type type; | 516 storage_monitor::StorageInfo::Type type; |
| 503 bool cracked = storage_monitor::StorageInfo::CrackDeviceId( | 517 bool cracked = storage_monitor::StorageInfo::CrackDeviceId( |
| 504 device_name, &type, &device_id); | 518 device_name, &type, &device_id); |
| 505 DCHECK(cracked); | 519 DCHECK(cracked); |
| 506 DCHECK_EQ(storage_monitor::StorageInfo::MAC_IMAGE_CAPTURE, type); | 520 DCHECK_EQ(storage_monitor::StorageInfo::MAC_IMAGE_CAPTURE, type); |
| 507 | 521 |
| 508 cb.Run(new MTPDeviceDelegateImplMac(device_id, device_location)); | 522 cb.Run(new MTPDeviceDelegateImplMac(device_id, device_location)); |
| 509 } | 523 } |
| OLD | NEW |