| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 // MTPDeviceDelegateImplWin implementation. | 5 // MTPDeviceDelegateImplWin implementation. |
| 6 | 6 |
| 7 #include "chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h" | 7 #include "chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h" |
| 8 | 8 |
| 9 #include <portabledevice.h> | 9 #include <portabledevice.h> |
| 10 | 10 |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 if (error != base::PLATFORM_FILE_OK) | 201 if (error != base::PLATFORM_FILE_OK) |
| 202 return error; | 202 return error; |
| 203 | 203 |
| 204 if (!file_info.is_directory) | 204 if (!file_info.is_directory) |
| 205 return base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY; | 205 return base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY; |
| 206 | 206 |
| 207 base::FilePath current; | 207 base::FilePath current; |
| 208 scoped_ptr<fileapi::FileSystemFileUtil::AbstractFileEnumerator> file_enum = | 208 scoped_ptr<fileapi::FileSystemFileUtil::AbstractFileEnumerator> file_enum = |
| 209 CreateFileEnumeratorOnBlockingPoolThread(device_info, root); | 209 CreateFileEnumeratorOnBlockingPoolThread(device_info, root); |
| 210 while (!(current = file_enum->Next()).empty()) { | 210 while (!(current = file_enum->Next()).empty()) { |
| 211 fileapi::AsyncFileUtil::Entry entry; | 211 fileapi::DirectoryEntry entry; |
| 212 entry.is_directory = file_enum->IsDirectory(); | 212 entry.is_directory = file_enum->IsDirectory(); |
| 213 entry.name = fileapi::VirtualPath::BaseName(current).value(); | 213 entry.name = fileapi::VirtualPath::BaseName(current).value(); |
| 214 entry.size = file_enum->Size(); | 214 entry.size = file_enum->Size(); |
| 215 entry.last_modified_time = file_enum->LastModifiedTime(); | 215 entry.last_modified_time = file_enum->LastModifiedTime(); |
| 216 entries->push_back(entry); | 216 entries->push_back(entry); |
| 217 } | 217 } |
| 218 return error; | 218 return error; |
| 219 } | 219 } |
| 220 | 220 |
| 221 // Gets the device file stream object on a blocking pool thread. | 221 // Gets the device file stream object on a blocking pool thread. |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 } else { | 613 } else { |
| 614 current_snapshot_details_->request_info().error_callback.Run( | 614 current_snapshot_details_->request_info().error_callback.Run( |
| 615 base::PLATFORM_FILE_ERROR_FAILED); | 615 base::PLATFORM_FILE_ERROR_FAILED); |
| 616 } | 616 } |
| 617 task_in_progress_ = false; | 617 task_in_progress_ = false; |
| 618 current_snapshot_details_.reset(); | 618 current_snapshot_details_.reset(); |
| 619 ProcessNextPendingRequest(); | 619 ProcessNextPendingRequest(); |
| 620 } | 620 } |
| 621 | 621 |
| 622 } // namespace chrome | 622 } // namespace chrome |
| OLD | NEW |