| 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 11 matching lines...) Expand all Loading... |
| 22 #include "base/task_runner_util.h" | 22 #include "base/task_runner_util.h" |
| 23 #include "base/threading/thread_restrictions.h" | 23 #include "base/threading/thread_restrictions.h" |
| 24 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" | 24 #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" |
| 25 #include "chrome/browser/media_galleries/win/mtp_device_object_entry.h" | 25 #include "chrome/browser/media_galleries/win/mtp_device_object_entry.h" |
| 26 #include "chrome/browser/media_galleries/win/mtp_device_object_enumerator.h" | 26 #include "chrome/browser/media_galleries/win/mtp_device_object_enumerator.h" |
| 27 #include "chrome/browser/media_galleries/win/mtp_device_operations_util.h" | 27 #include "chrome/browser/media_galleries/win/mtp_device_operations_util.h" |
| 28 #include "chrome/browser/media_galleries/win/portable_device_map_service.h" | 28 #include "chrome/browser/media_galleries/win/portable_device_map_service.h" |
| 29 #include "chrome/browser/media_galleries/win/snapshot_file_details.h" | 29 #include "chrome/browser/media_galleries/win/snapshot_file_details.h" |
| 30 #include "components/storage_monitor/storage_monitor.h" | 30 #include "components/storage_monitor/storage_monitor.h" |
| 31 #include "content/public/browser/browser_thread.h" | 31 #include "content/public/browser/browser_thread.h" |
| 32 #include "webkit/common/fileapi/file_system_util.h" | 32 #include "storage/common/fileapi/file_system_util.h" |
| 33 | 33 |
| 34 namespace { | 34 namespace { |
| 35 | 35 |
| 36 // Gets the details of the MTP partition storage specified by the | 36 // Gets the details of the MTP partition storage specified by the |
| 37 // |storage_path| on the UI thread. Returns true if the storage details are | 37 // |storage_path| on the UI thread. Returns true if the storage details are |
| 38 // valid and returns false otherwise. | 38 // valid and returns false otherwise. |
| 39 bool GetStorageInfoOnUIThread(const base::string16& storage_path, | 39 bool GetStorageInfoOnUIThread(const base::string16& storage_path, |
| 40 base::string16* pnp_device_id, | 40 base::string16* pnp_device_id, |
| 41 base::string16* storage_object_id) { | 41 base::string16* storage_object_id) { |
| 42 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 42 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 current_snapshot_details_->file_info(), | 616 current_snapshot_details_->file_info(), |
| 617 current_snapshot_details_->request_info().snapshot_file_path); | 617 current_snapshot_details_->request_info().snapshot_file_path); |
| 618 } else { | 618 } else { |
| 619 current_snapshot_details_->request_info().error_callback.Run( | 619 current_snapshot_details_->request_info().error_callback.Run( |
| 620 base::File::FILE_ERROR_FAILED); | 620 base::File::FILE_ERROR_FAILED); |
| 621 } | 621 } |
| 622 task_in_progress_ = false; | 622 task_in_progress_ = false; |
| 623 current_snapshot_details_.reset(); | 623 current_snapshot_details_.reset(); |
| 624 ProcessNextPendingRequest(); | 624 ProcessNextPendingRequest(); |
| 625 } | 625 } |
| OLD | NEW |