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

Side by Side Diff: chrome/browser/chromeos/file_manager/fake_disk_mount_manager.cc

Issue 2201023002: Change access mode of disk devices when mounting based on config. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test case to check read_only parameter to disk mount manager. Created 4 years, 4 months 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
OLDNEW
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 #include "chrome/browser/chromeos/file_manager/fake_disk_mount_manager.h" 5 #include "chrome/browser/chromeos/file_manager/fake_disk_mount_manager.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 9
10 namespace file_manager { 10 namespace file_manager {
11 11
12 FakeDiskMountManager::MountRequest::MountRequest( 12 FakeDiskMountManager::MountRequest::MountRequest(
13 const std::string& source_path, 13 const std::string& source_path,
14 const std::string& source_format, 14 const std::string& source_format,
15 const std::string& mount_label, 15 const std::string& mount_label,
16 chromeos::MountType type) 16 chromeos::MountType type,
17 bool read_only)
hashimoto 2016/08/05 07:27:46 Shouldn't this be MountAccessMode instead of bool?
yamaguchi 2016/08/08 05:53:44 Done.
17 : source_path(source_path), 18 : source_path(source_path),
18 source_format(source_format), 19 source_format(source_format),
19 mount_label(mount_label), 20 mount_label(mount_label),
20 type(type) { 21 type(type),
21 } 22 read_only(read_only) {}
22 23
23 FakeDiskMountManager::MountRequest::MountRequest(const MountRequest& other) = 24 FakeDiskMountManager::MountRequest::MountRequest(const MountRequest& other) =
24 default; 25 default;
25 26
26 FakeDiskMountManager::UnmountRequest::UnmountRequest( 27 FakeDiskMountManager::UnmountRequest::UnmountRequest(
27 const std::string& mount_path, 28 const std::string& mount_path,
28 chromeos::UnmountOptions options) 29 chromeos::UnmountOptions options)
29 : mount_path(mount_path), 30 : mount_path(mount_path),
30 options(options) { 31 options(options) {
31 } 32 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 69
69 void FakeDiskMountManager::EnsureMountInfoRefreshed( 70 void FakeDiskMountManager::EnsureMountInfoRefreshed(
70 const EnsureMountInfoRefreshedCallback& callback, 71 const EnsureMountInfoRefreshedCallback& callback,
71 bool force) { 72 bool force) {
72 callback.Run(true); 73 callback.Run(true);
73 } 74 }
74 75
75 void FakeDiskMountManager::MountPath(const std::string& source_path, 76 void FakeDiskMountManager::MountPath(const std::string& source_path,
76 const std::string& source_format, 77 const std::string& source_format,
77 const std::string& mount_label, 78 const std::string& mount_label,
78 chromeos::MountType type) { 79 chromeos::MountType type,
80 chromeos::MountAccessMode access_mode) {
79 mount_requests_.push_back( 81 mount_requests_.push_back(
80 MountRequest(source_path, source_format, mount_label, type)); 82 MountRequest(source_path, source_format, mount_label, type, access_mode));
81 83
82 const MountPointInfo mount_point( 84 const MountPointInfo mount_point(
83 source_path, 85 source_path,
84 source_path, 86 source_path,
85 type, 87 type,
86 chromeos::disks::MOUNT_CONDITION_NONE); 88 chromeos::disks::MOUNT_CONDITION_NONE);
87 mount_points_.insert(make_pair(source_path, mount_point)); 89 mount_points_.insert(make_pair(source_path, mount_point));
88 FOR_EACH_OBSERVER(DiskMountManager::Observer, observers_, 90 FOR_EACH_OBSERVER(DiskMountManager::Observer, observers_,
89 OnMountEvent(DiskMountManager::MOUNTING, 91 OnMountEvent(DiskMountManager::MOUNTING,
90 chromeos::MOUNT_ERROR_NONE, 92 chromeos::MOUNT_ERROR_NONE,
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 130
129 void FakeDiskMountManager::InvokeDiskEventForTest( 131 void FakeDiskMountManager::InvokeDiskEventForTest(
130 chromeos::disks::DiskMountManager::DiskEvent event, 132 chromeos::disks::DiskMountManager::DiskEvent event,
131 const chromeos::disks::DiskMountManager::Disk* disk) { 133 const chromeos::disks::DiskMountManager::Disk* disk) {
132 FOR_EACH_OBSERVER(chromeos::disks::DiskMountManager::Observer, 134 FOR_EACH_OBSERVER(chromeos::disks::DiskMountManager::Observer,
133 observers_, 135 observers_,
134 OnDiskEvent(event, disk)); 136 OnDiskEvent(event, disk));
135 } 137 }
136 138
137 } // namespace file_manager 139 } // namespace file_manager
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/file_manager/fake_disk_mount_manager.h ('k') | chrome/browser/chromeos/file_manager/volume_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698