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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 const MountCompletedHandler& mount_completed_handler) OVERRIDE { | 449 const MountCompletedHandler& mount_completed_handler) OVERRIDE { |
450 mount_event_handler_ = mount_event_handler; | 450 mount_event_handler_ = mount_event_handler; |
451 mount_completed_handler_ = mount_completed_handler; | 451 mount_completed_handler_ = mount_completed_handler; |
452 } | 452 } |
453 | 453 |
454 private: | 454 private: |
455 // Performs file actions for Mount(). | 455 // Performs file actions for Mount(). |
456 static MountError PerformFakeMount(const std::string& source_path, | 456 static MountError PerformFakeMount(const std::string& source_path, |
457 const base::FilePath& mounted_path) { | 457 const base::FilePath& mounted_path) { |
458 // Check the source path exists. | 458 // Check the source path exists. |
459 if (!file_util::PathExists(base::FilePath::FromUTF8Unsafe(source_path))) { | 459 if (!base::PathExists(base::FilePath::FromUTF8Unsafe(source_path))) { |
460 DLOG(ERROR) << "Source does not exist at " << source_path; | 460 DLOG(ERROR) << "Source does not exist at " << source_path; |
461 return MOUNT_ERROR_INVALID_PATH; | 461 return MOUNT_ERROR_INVALID_PATH; |
462 } | 462 } |
463 | 463 |
464 // Just create an empty directory and shows it as the mounted directory. | 464 // Just create an empty directory and shows it as the mounted directory. |
465 if (!file_util::CreateDirectory(mounted_path)) { | 465 if (!file_util::CreateDirectory(mounted_path)) { |
466 DLOG(ERROR) << "Failed to create directory at " << mounted_path.value(); | 466 DLOG(ERROR) << "Failed to create directory at " << mounted_path.value(); |
467 return MOUNT_ERROR_DIRECTORY_CREATION_FAILED; | 467 return MOUNT_ERROR_DIRECTORY_CREATION_FAILED; |
468 } | 468 } |
469 | 469 |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 } | 715 } |
716 | 716 |
717 // static | 717 // static |
718 base::FilePath CrosDisksClient::GetRemovableDiskMountPoint() { | 718 base::FilePath CrosDisksClient::GetRemovableDiskMountPoint() { |
719 return base::FilePath(base::chromeos::IsRunningOnChromeOS() ? | 719 return base::FilePath(base::chromeos::IsRunningOnChromeOS() ? |
720 FILE_PATH_LITERAL("/media/removable") : | 720 FILE_PATH_LITERAL("/media/removable") : |
721 FILE_PATH_LITERAL("/tmp/chromeos/media/removable")); | 721 FILE_PATH_LITERAL("/tmp/chromeos/media/removable")); |
722 } | 722 } |
723 | 723 |
724 } // namespace chromeos | 724 } // namespace chromeos |
OLD | NEW |