| 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/linux/mtp_device_delegate_impl_linux.h" | 5 #include "chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "chrome/browser/media_galleries/linux/mtp_device_task_helper.h" | 10 #include "chrome/browser/media_galleries/linux/mtp_device_task_helper.h" |
| 11 #include "chrome/browser/media_galleries/linux/mtp_device_task_helper_map_servic
e.h" | 11 #include "chrome/browser/media_galleries/linux/mtp_device_task_helper_map_servic
e.h" |
| 12 #include "chrome/browser/media_galleries/linux/snapshot_file_details.h" | 12 #include "chrome/browser/media_galleries/linux/snapshot_file_details.h" |
| 13 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
| 14 | 14 |
| 15 namespace chrome { | |
| 16 | |
| 17 namespace { | 15 namespace { |
| 18 | 16 |
| 19 // File path separator constant. | 17 // File path separator constant. |
| 20 const char kRootPath[] = "/"; | 18 const char kRootPath[] = "/"; |
| 21 | 19 |
| 22 // Returns the device relative file path given |file_path|. | 20 // Returns the device relative file path given |file_path|. |
| 23 // E.g.: If the |file_path| is "/usb:2,2:12345/DCIM" and |registered_dev_path| | 21 // E.g.: If the |file_path| is "/usb:2,2:12345/DCIM" and |registered_dev_path| |
| 24 // is "/usb:2,2:12345", this function returns the device relative path which is | 22 // is "/usb:2,2:12345", this function returns the device relative path which is |
| 25 // "/DCIM". | 23 // "/DCIM". |
| 26 std::string GetDeviceRelativePath(const base::FilePath& registered_dev_path, | 24 std::string GetDeviceRelativePath(const base::FilePath& registered_dev_path, |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 task_in_progress_ = false; | 447 task_in_progress_ = false; |
| 450 ProcessNextPendingRequest(); | 448 ProcessNextPendingRequest(); |
| 451 } | 449 } |
| 452 | 450 |
| 453 void CreateMTPDeviceAsyncDelegate( | 451 void CreateMTPDeviceAsyncDelegate( |
| 454 const std::string& device_location, | 452 const std::string& device_location, |
| 455 const CreateMTPDeviceAsyncDelegateCallback& callback) { | 453 const CreateMTPDeviceAsyncDelegateCallback& callback) { |
| 456 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 454 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
| 457 callback.Run(new MTPDeviceDelegateImplLinux(device_location)); | 455 callback.Run(new MTPDeviceDelegateImplLinux(device_location)); |
| 458 } | 456 } |
| 459 | |
| 460 } // namespace chrome | |
| OLD | NEW |