Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: chromeos/dbus/fake_cros_disks_client.cc

Issue 2392503002: Allow to pass remount option to Mount method of cros_disks_client. (Closed)
Patch Set: Rename enum item names to be more readable. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chromeos/dbus/fake_cros_disks_client.h ('k') | chromeos/disks/disk_mount_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_cros_disks_client.h ('k') | chromeos/disks/disk_mount_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698