| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "chromeos/dbus/fake_cros_disks_client.h" | 5 #include "chromeos/dbus/fake_cros_disks_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 FakeCrosDisksClient::~FakeCrosDisksClient() { | 73 FakeCrosDisksClient::~FakeCrosDisksClient() { |
| 74 } | 74 } |
| 75 | 75 |
| 76 void FakeCrosDisksClient::Init(dbus::Bus* bus) { | 76 void FakeCrosDisksClient::Init(dbus::Bus* bus) { |
| 77 } | 77 } |
| 78 | 78 |
| 79 void FakeCrosDisksClient::Mount(const std::string& source_path, | 79 void FakeCrosDisksClient::Mount(const std::string& source_path, |
| 80 const std::string& source_format, | 80 const std::string& source_format, |
| 81 const std::string& mount_label, | 81 const std::string& mount_label, |
| 82 MountAccessMode access_mode, | 82 MountAccessMode access_mode, |
| 83 RemountOption remount, |
| 83 const base::Closure& callback, | 84 const base::Closure& callback, |
| 84 const base::Closure& error_callback) { | 85 const base::Closure& error_callback) { |
| 85 // This fake implementation assumes mounted path is device when source_format | 86 // This fake implementation assumes mounted path is device when source_format |
| 86 // is empty, or an archive otherwise. | 87 // is empty, or an archive otherwise. |
| 87 MountType type = | 88 MountType type = |
| 88 (source_format == "") ? MOUNT_TYPE_DEVICE : MOUNT_TYPE_ARCHIVE; | 89 (source_format == "") ? MOUNT_TYPE_DEVICE : MOUNT_TYPE_ARCHIVE; |
| 89 | 90 |
| 90 base::FilePath mounted_path; | 91 base::FilePath mounted_path; |
| 91 switch (type) { | 92 switch (type) { |
| 92 case MOUNT_TYPE_ARCHIVE: | 93 case MOUNT_TYPE_ARCHIVE: |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 bool FakeCrosDisksClient::SendFormatCompletedEvent( | 215 bool FakeCrosDisksClient::SendFormatCompletedEvent( |
| 215 FormatError error_code, | 216 FormatError error_code, |
| 216 const std::string& device_path) { | 217 const std::string& device_path) { |
| 217 if (format_completed_handler_.is_null()) | 218 if (format_completed_handler_.is_null()) |
| 218 return false; | 219 return false; |
| 219 format_completed_handler_.Run(error_code, device_path); | 220 format_completed_handler_.Run(error_code, device_path); |
| 220 return true; | 221 return true; |
| 221 } | 222 } |
| 222 | 223 |
| 223 } // namespace chromeos | 224 } // namespace chromeos |
| OLD | NEW |