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/chromeos/disks/disk_mount_manager.h" | 5 #include "chrome/browser/chromeos/disks/disk_mount_manager.h" |
6 | 6 |
7 #include <sys/statvfs.h> | 7 #include <sys/statvfs.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 223 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
224 cros_disks_client_->EnumerateAutoMountableDevices( | 224 cros_disks_client_->EnumerateAutoMountableDevices( |
225 base::Bind(&DiskMountManagerImpl::OnRequestMountInfo, | 225 base::Bind(&DiskMountManagerImpl::OnRequestMountInfo, |
226 weak_ptr_factory_.GetWeakPtr()), | 226 weak_ptr_factory_.GetWeakPtr()), |
227 base::Bind(&base::DoNothing)); | 227 base::Bind(&base::DoNothing)); |
228 } | 228 } |
229 | 229 |
230 // DiskMountManager override. | 230 // DiskMountManager override. |
231 const DiskMap& disks() const OVERRIDE { return disks_; } | 231 const DiskMap& disks() const OVERRIDE { return disks_; } |
232 | 232 |
| 233 // DiskMountManager override. |
| 234 virtual const Disk* FindDiskBySourcePath(const std::string& source_path) |
| 235 const OVERRIDE { |
| 236 DiskMap::const_iterator disk_it = disks_.find(source_path); |
| 237 return disk_it == disks_.end() ? NULL : disk_it->second; |
| 238 } |
233 | 239 |
234 // DiskMountManager override. | 240 // DiskMountManager override. |
235 const MountPointMap& mount_points() const OVERRIDE { return mount_points_; } | 241 const MountPointMap& mount_points() const OVERRIDE { return mount_points_; } |
236 | 242 |
237 private: | 243 private: |
238 struct UnmountDeviceRecursiveCallbackData { | 244 struct UnmountDeviceRecursiveCallbackData { |
239 void* user_data; | 245 void* user_data; |
240 UnmountDeviceRecursiveCallbackType callback; | 246 UnmountDeviceRecursiveCallbackType callback; |
241 size_t pending_callbacks_count; | 247 size_t pending_callbacks_count; |
242 | 248 |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 VLOG(1) << "DiskMountManager Shutdown completed"; | 697 VLOG(1) << "DiskMountManager Shutdown completed"; |
692 } | 698 } |
693 | 699 |
694 // static | 700 // static |
695 DiskMountManager* DiskMountManager::GetInstance() { | 701 DiskMountManager* DiskMountManager::GetInstance() { |
696 return g_disk_mount_manager; | 702 return g_disk_mount_manager; |
697 } | 703 } |
698 | 704 |
699 } // namespace disks | 705 } // namespace disks |
700 } // namespace chromeos | 706 } // namespace chromeos |
OLD | NEW |