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 "chromeos/dbus/cros_disks_client.h" | 5 #include "chromeos/dbus/cros_disks_client.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/chromeos/chromeos_version.h" | 10 #include "base/chromeos/chromeos_version.h" |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 if (mounted_to_source_path_map_.count(device_path) == 0) { | 402 if (mounted_to_source_path_map_.count(device_path) == 0) { |
403 base::MessageLoopProxy::current()->PostTask(FROM_HERE, error_callback); | 403 base::MessageLoopProxy::current()->PostTask(FROM_HERE, error_callback); |
404 return; | 404 return; |
405 } | 405 } |
406 | 406 |
407 mounted_to_source_path_map_.erase(device_path); | 407 mounted_to_source_path_map_.erase(device_path); |
408 | 408 |
409 // Remove the directory created in Mount(). | 409 // Remove the directory created in Mount(). |
410 base::WorkerPool::PostTaskAndReply( | 410 base::WorkerPool::PostTaskAndReply( |
411 FROM_HERE, | 411 FROM_HERE, |
412 base::Bind(base::IgnoreResult(&base::Delete), | 412 base::Bind(base::IgnoreResult(&base::DeleteFile), |
413 base::FilePath::FromUTF8Unsafe(device_path), | 413 base::FilePath::FromUTF8Unsafe(device_path), |
414 true /* recursive */), | 414 true /* recursive */), |
415 callback, | 415 callback, |
416 true /* task_is_slow */); | 416 true /* task_is_slow */); |
417 } | 417 } |
418 | 418 |
419 virtual void EnumerateAutoMountableDevices( | 419 virtual void EnumerateAutoMountableDevices( |
420 const EnumerateAutoMountableDevicesCallback& callback, | 420 const EnumerateAutoMountableDevicesCallback& callback, |
421 const base::Closure& error_callback) OVERRIDE { | 421 const base::Closure& error_callback) OVERRIDE { |
422 std::vector<std::string> device_paths; | 422 std::vector<std::string> device_paths; |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 } | 709 } |
710 | 710 |
711 // static | 711 // static |
712 base::FilePath CrosDisksClient::GetRemovableDiskMountPoint() { | 712 base::FilePath CrosDisksClient::GetRemovableDiskMountPoint() { |
713 return base::FilePath(base::chromeos::IsRunningOnChromeOS() ? | 713 return base::FilePath(base::chromeos::IsRunningOnChromeOS() ? |
714 FILE_PATH_LITERAL("/media/removable") : | 714 FILE_PATH_LITERAL("/media/removable") : |
715 FILE_PATH_LITERAL("/tmp/chromeos/media/removable")); | 715 FILE_PATH_LITERAL("/tmp/chromeos/media/removable")); |
716 } | 716 } |
717 | 717 |
718 } // namespace chromeos | 718 } // namespace chromeos |
OLD | NEW |