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/disks/mock_disk_mount_manager.h" | 5 #include "chromeos/disks/mock_disk_mount_manager.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
174 .Times(AnyNumber()); | 174 .Times(AnyNumber()); |
175 } | 175 } |
176 | 176 |
177 void MockDiskMountManager::CreateDiskEntryForMountDevice( | 177 void MockDiskMountManager::CreateDiskEntryForMountDevice( |
178 const DiskMountManager::MountPointInfo& mount_info, | 178 const DiskMountManager::MountPointInfo& mount_info, |
179 const std::string& device_id, | 179 const std::string& device_id, |
180 const std::string& device_label, | 180 const std::string& device_label, |
181 const std::string& vendor_name, | 181 const std::string& vendor_name, |
182 const std::string& product_name, | 182 const std::string& product_name, |
183 DeviceType device_type, | 183 DeviceType device_type, |
184 uint64 total_size_in_bytes) { | 184 uint64 total_size_in_bytes, |
185 bool is_parent, | |
186 bool has_media, | |
187 bool on_boot_device) { | |
185 Disk* disk = new DiskMountManager::Disk(std::string(mount_info.source_path), | 188 Disk* disk = new DiskMountManager::Disk(std::string(mount_info.source_path), |
hashimoto
2014/03/27 02:22:40
nit: std::string(...) is unnecessary.
No need to c
Drew Haven
2014/03/27 19:31:12
That was there before, so I just left it. Might a
| |
186 std::string(mount_info.mount_path), | 189 std::string(mount_info.mount_path), |
hashimoto
2014/03/27 02:22:40
ditto.
Drew Haven
2014/03/27 19:31:12
Done.
| |
187 std::string(), // system_path | 190 std::string(), // system_path |
188 std::string(), // file_path | 191 std::string(mount_info.source_path), |
hashimoto
2014/03/27 02:22:40
ditto.
Drew Haven
2014/03/27 19:31:12
Done.
| |
189 device_label, // device_label | 192 device_label, // device_label |
hashimoto
2014/03/27 02:22:40
nit: > "// device label"
This kind of comment may
Drew Haven
2014/03/27 19:31:12
Done.
| |
190 std::string(), // drive_label | 193 std::string(), // drive_label |
191 std::string(), // vendor_id | 194 std::string(), // vendor_id |
192 vendor_name, | 195 vendor_name, |
193 std::string(), // product_id | 196 std::string(), // product_id |
194 product_name, | 197 product_name, |
195 device_id, // fs_uuid | 198 device_id, // fs_uuid |
196 std::string(), // system_path_prefix | 199 std::string(), // system_path_prefix |
197 device_type, | 200 device_type, |
198 total_size_in_bytes, | 201 total_size_in_bytes, |
199 false, // is_parent | 202 is_parent, // is_parent |
200 false, // is_read_only | 203 false, // is_read_only |
201 true, // has_media | 204 has_media, // has_media |
202 false, // on_boot_device | 205 on_boot_device, // on_boot_device |
hashimoto
2014/03/27 02:22:40
ditto for these four fields.
Drew Haven
2014/03/27 19:31:12
Done.
| |
203 false); // is_hidden | 206 false); // is_hidden |
204 DiskMountManager::DiskMap::iterator it = disks_.find(mount_info.source_path); | 207 DiskMountManager::DiskMap::iterator it = disks_.find(mount_info.source_path); |
205 if (it == disks_.end()) { | 208 if (it == disks_.end()) { |
206 disks_.insert(std::make_pair(std::string(mount_info.source_path), disk)); | 209 disks_.insert(std::make_pair(std::string(mount_info.source_path), disk)); |
207 } else { | 210 } else { |
208 delete it->second; | 211 delete it->second; |
209 it->second = disk; | 212 it->second = disk; |
210 } | 213 } |
211 } | 214 } |
212 | 215 |
213 void MockDiskMountManager::RemoveDiskEntryForMountDevice( | 216 void MockDiskMountManager::RemoveDiskEntryForMountDevice( |
(...skipping 23 matching lines...) Expand all Loading... | |
237 FOR_EACH_OBSERVER(Observer, observers_, OnDiskEvent(event, disk)); | 240 FOR_EACH_OBSERVER(Observer, observers_, OnDiskEvent(event, disk)); |
238 } | 241 } |
239 | 242 |
240 void MockDiskMountManager::NotifyDeviceChanged(DeviceEvent event, | 243 void MockDiskMountManager::NotifyDeviceChanged(DeviceEvent event, |
241 const std::string& path) { | 244 const std::string& path) { |
242 FOR_EACH_OBSERVER(Observer, observers_, OnDeviceEvent(event, path)); | 245 FOR_EACH_OBSERVER(Observer, observers_, OnDeviceEvent(event, path)); |
243 } | 246 } |
244 | 247 |
245 } // namespace disks | 248 } // namespace disks |
246 } // namespace chromeos | 249 } // namespace chromeos |
OLD | NEW |