| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FAKE_DISK_MOUNT_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FAKE_DISK_MOUNT_MANAGER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FAKE_DISK_MOUNT_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FAKE_DISK_MOUNT_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
| 14 #include "chromeos/dbus/cros_disks_client.h" | 14 #include "chromeos/dbus/cros_disks_client.h" |
| 15 #include "chromeos/disks/disk_mount_manager.h" | 15 #include "chromeos/disks/disk_mount_manager.h" |
| 16 | 16 |
| 17 namespace file_manager { | 17 namespace file_manager { |
| 18 | 18 |
| 19 class FakeDiskMountManager : public chromeos::disks::DiskMountManager { | 19 class FakeDiskMountManager : public chromeos::disks::DiskMountManager { |
| 20 public: | 20 public: |
| 21 struct MountRequest { | 21 struct MountRequest { |
| 22 MountRequest(const std::string& source_path, | 22 MountRequest(const std::string& source_path, |
| 23 const std::string& source_format, | 23 const std::string& source_format, |
| 24 const std::string& mount_label, | 24 const std::string& mount_label, |
| 25 chromeos::MountType type); | 25 chromeos::MountType type, |
| 26 bool read_only); |
| 26 MountRequest(const MountRequest& other); | 27 MountRequest(const MountRequest& other); |
| 27 | 28 |
| 28 std::string source_path; | 29 std::string source_path; |
| 29 std::string source_format; | 30 std::string source_format; |
| 30 std::string mount_label; | 31 std::string mount_label; |
| 31 chromeos::MountType type; | 32 chromeos::MountType type; |
| 33 bool read_only; |
| 32 }; | 34 }; |
| 33 | 35 |
| 34 struct UnmountRequest { | 36 struct UnmountRequest { |
| 35 UnmountRequest(const std::string& mount_path, | 37 UnmountRequest(const std::string& mount_path, |
| 36 chromeos::UnmountOptions options); | 38 chromeos::UnmountOptions options); |
| 37 | 39 |
| 38 std::string mount_path; | 40 std::string mount_path; |
| 39 chromeos::UnmountOptions options; | 41 chromeos::UnmountOptions options; |
| 40 }; | 42 }; |
| 41 | 43 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 55 const DiskMap& disks() const override; | 57 const DiskMap& disks() const override; |
| 56 const Disk* FindDiskBySourcePath( | 58 const Disk* FindDiskBySourcePath( |
| 57 const std::string& source_path) const override; | 59 const std::string& source_path) const override; |
| 58 const MountPointMap& mount_points() const override; | 60 const MountPointMap& mount_points() const override; |
| 59 void EnsureMountInfoRefreshed( | 61 void EnsureMountInfoRefreshed( |
| 60 const EnsureMountInfoRefreshedCallback& callback, | 62 const EnsureMountInfoRefreshedCallback& callback, |
| 61 bool force) override; | 63 bool force) override; |
| 62 void MountPath(const std::string& source_path, | 64 void MountPath(const std::string& source_path, |
| 63 const std::string& source_format, | 65 const std::string& source_format, |
| 64 const std::string& mount_label, | 66 const std::string& mount_label, |
| 65 chromeos::MountType type) override; | 67 chromeos::MountType type, |
| 68 chromeos::MountAccessMode access_mode) override; |
| 66 void UnmountPath(const std::string& mount_path, | 69 void UnmountPath(const std::string& mount_path, |
| 67 chromeos::UnmountOptions options, | 70 chromeos::UnmountOptions options, |
| 68 const UnmountPathCallback& callback) override; | 71 const UnmountPathCallback& callback) override; |
| 69 void FormatMountedDevice(const std::string& mount_path) override; | 72 void FormatMountedDevice(const std::string& mount_path) override; |
| 70 void UnmountDeviceRecursively( | 73 void UnmountDeviceRecursively( |
| 71 const std::string& device_path, | 74 const std::string& device_path, |
| 72 const UnmountDeviceRecursivelyCallbackType& callback) override; | 75 const UnmountDeviceRecursivelyCallbackType& callback) override; |
| 73 | 76 |
| 74 bool AddDiskForTest(Disk* disk) override; | 77 bool AddDiskForTest(Disk* disk) override; |
| 75 bool AddMountPointForTest(const MountPointInfo& mount_point) override; | 78 bool AddMountPointForTest(const MountPointInfo& mount_point) override; |
| 76 void InvokeDiskEventForTest(DiskEvent event, const Disk* disk); | 79 void InvokeDiskEventForTest(DiskEvent event, const Disk* disk); |
| 77 | 80 |
| 78 private: | 81 private: |
| 79 base::ObserverList<Observer> observers_; | 82 base::ObserverList<Observer> observers_; |
| 80 | 83 |
| 81 DiskMap disks_; | 84 DiskMap disks_; |
| 82 MountPointMap mount_points_; | 85 MountPointMap mount_points_; |
| 83 | 86 |
| 84 std::vector<MountRequest> mount_requests_; | 87 std::vector<MountRequest> mount_requests_; |
| 85 std::vector<UnmountRequest> unmount_requests_; | 88 std::vector<UnmountRequest> unmount_requests_; |
| 86 | 89 |
| 87 DISALLOW_COPY_AND_ASSIGN(FakeDiskMountManager); | 90 DISALLOW_COPY_AND_ASSIGN(FakeDiskMountManager); |
| 88 }; | 91 }; |
| 89 | 92 |
| 90 } // namespace file_manager | 93 } // namespace file_manager |
| 91 | 94 |
| 92 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FAKE_DISK_MOUNT_MANAGER_H_ | 95 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_FAKE_DISK_MOUNT_MANAGER_H_ |
| OLD | NEW |