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" |
11 #include "components/storage_monitor/image_capture_device.h" | 11 #include "components/storage_monitor/image_capture_device.h" |
12 #include "components/storage_monitor/image_capture_device_manager.h" | 12 #include "components/storage_monitor/image_capture_device_manager.h" |
13 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
14 #include "webkit/browser/fileapi/async_file_util.h" | 14 #include "storage/browser/fileapi/async_file_util.h" |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 int kReadDirectoryTimeLimitSeconds = 20; | 18 int kReadDirectoryTimeLimitSeconds = 20; |
19 | 19 |
20 typedef MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback | 20 typedef MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback |
21 CreateSnapshotFileSuccessCallback; | 21 CreateSnapshotFileSuccessCallback; |
22 typedef MTPDeviceAsyncDelegate::ErrorCallback ErrorCallback; | 22 typedef MTPDeviceAsyncDelegate::ErrorCallback ErrorCallback; |
23 typedef MTPDeviceAsyncDelegate::GetFileInfoSuccessCallback | 23 typedef MTPDeviceAsyncDelegate::GetFileInfoSuccessCallback |
24 GetFileInfoSuccessCallback; | 24 GetFileInfoSuccessCallback; |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 std::string device_name = base::FilePath(device_location).BaseName().value(); | 484 std::string device_name = base::FilePath(device_location).BaseName().value(); |
485 std::string device_id; | 485 std::string device_id; |
486 storage_monitor::StorageInfo::Type type; | 486 storage_monitor::StorageInfo::Type type; |
487 bool cracked = storage_monitor::StorageInfo::CrackDeviceId( | 487 bool cracked = storage_monitor::StorageInfo::CrackDeviceId( |
488 device_name, &type, &device_id); | 488 device_name, &type, &device_id); |
489 DCHECK(cracked); | 489 DCHECK(cracked); |
490 DCHECK_EQ(storage_monitor::StorageInfo::MAC_IMAGE_CAPTURE, type); | 490 DCHECK_EQ(storage_monitor::StorageInfo::MAC_IMAGE_CAPTURE, type); |
491 | 491 |
492 cb.Run(new MTPDeviceDelegateImplMac(device_id, device_location)); | 492 cb.Run(new MTPDeviceDelegateImplMac(device_id, device_location)); |
493 } | 493 } |
OLD | NEW |