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" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 } | 171 } |
172 | 172 |
173 MTPDeviceDelegateImplLinux::MTPDeviceDelegateImplLinux( | 173 MTPDeviceDelegateImplLinux::MTPDeviceDelegateImplLinux( |
174 const std::string& device_location) | 174 const std::string& device_location) |
175 : init_state_(UNINITIALIZED), | 175 : init_state_(UNINITIALIZED), |
176 task_in_progress_(false), | 176 task_in_progress_(false), |
177 device_path_(device_location), | 177 device_path_(device_location), |
178 weak_ptr_factory_(this) { | 178 weak_ptr_factory_(this) { |
179 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 179 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
180 DCHECK(!device_path_.empty()); | 180 DCHECK(!device_path_.empty()); |
181 RemoveChars(device_location, kRootPath, &storage_name_); | 181 base::RemoveChars(device_location, kRootPath, &storage_name_); |
182 DCHECK(!storage_name_.empty()); | 182 DCHECK(!storage_name_.empty()); |
183 } | 183 } |
184 | 184 |
185 MTPDeviceDelegateImplLinux::~MTPDeviceDelegateImplLinux() { | 185 MTPDeviceDelegateImplLinux::~MTPDeviceDelegateImplLinux() { |
186 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 186 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
187 } | 187 } |
188 | 188 |
189 void MTPDeviceDelegateImplLinux::GetFileInfo( | 189 void MTPDeviceDelegateImplLinux::GetFileInfo( |
190 const base::FilePath& file_path, | 190 const base::FilePath& file_path, |
191 const GetFileInfoSuccessCallback& success_callback, | 191 const GetFileInfoSuccessCallback& success_callback, |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 task_in_progress_ = false; | 447 task_in_progress_ = false; |
448 ProcessNextPendingRequest(); | 448 ProcessNextPendingRequest(); |
449 } | 449 } |
450 | 450 |
451 void CreateMTPDeviceAsyncDelegate( | 451 void CreateMTPDeviceAsyncDelegate( |
452 const std::string& device_location, | 452 const std::string& device_location, |
453 const CreateMTPDeviceAsyncDelegateCallback& callback) { | 453 const CreateMTPDeviceAsyncDelegateCallback& callback) { |
454 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 454 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
455 callback.Run(new MTPDeviceDelegateImplLinux(device_location)); | 455 callback.Run(new MTPDeviceDelegateImplLinux(device_location)); |
456 } | 456 } |
OLD | NEW |