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

Side by Side Diff: chromeos/disks/mock_disk_mount_manager.h

Issue 379743004: Add a method in DiskMountManager to refresh mount entries in addition to devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review comments + Fix up MockDiskMountManager. Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « chromeos/disks/disk_mount_manager.cc ('k') | chromeos/disks/mock_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) 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 #ifndef CHROMEOS_DISKS_MOCK_DISK_MOUNT_MANAGER_H_ 5 #ifndef CHROMEOS_DISKS_MOCK_DISK_MOUNT_MANAGER_H_
6 #define CHROMEOS_DISKS_MOCK_DISK_MOUNT_MANAGER_H_ 6 #define CHROMEOS_DISKS_MOCK_DISK_MOUNT_MANAGER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/observer_list.h" 10 #include "base/observer_list.h"
(...skipping 14 matching lines...) Expand all
25 25
26 // DiskMountManager override. 26 // DiskMountManager override.
27 MOCK_METHOD0(Init, void(void)); 27 MOCK_METHOD0(Init, void(void));
28 MOCK_METHOD1(AddObserver, void(DiskMountManager::Observer*)); 28 MOCK_METHOD1(AddObserver, void(DiskMountManager::Observer*));
29 MOCK_METHOD1(RemoveObserver, void(DiskMountManager::Observer*)); 29 MOCK_METHOD1(RemoveObserver, void(DiskMountManager::Observer*));
30 MOCK_CONST_METHOD0(disks, const DiskMountManager::DiskMap&(void)); 30 MOCK_CONST_METHOD0(disks, const DiskMountManager::DiskMap&(void));
31 MOCK_CONST_METHOD1(FindDiskBySourcePath, 31 MOCK_CONST_METHOD1(FindDiskBySourcePath,
32 const DiskMountManager::Disk*(const std::string&)); 32 const DiskMountManager::Disk*(const std::string&));
33 MOCK_CONST_METHOD0(mount_points, 33 MOCK_CONST_METHOD0(mount_points,
34 const DiskMountManager::MountPointMap&(void)); 34 const DiskMountManager::MountPointMap&(void));
35 MOCK_METHOD0(RequestMountInfoRefresh, void(void)); 35 MOCK_METHOD1(EnsureMountInfoRefreshed,
36 void(const EnsureMountInfoRefreshedCallback&));
36 MOCK_METHOD4(MountPath, void(const std::string&, const std::string&, 37 MOCK_METHOD4(MountPath, void(const std::string&, const std::string&,
37 const std::string&, MountType)); 38 const std::string&, MountType));
38 MOCK_METHOD3(UnmountPath, void(const std::string&, 39 MOCK_METHOD3(UnmountPath, void(const std::string&,
39 UnmountOptions, 40 UnmountOptions,
40 const DiskMountManager::UnmountPathCallback&)); 41 const DiskMountManager::UnmountPathCallback&));
41 MOCK_METHOD1(FormatMountedDevice, void(const std::string&)); 42 MOCK_METHOD1(FormatMountedDevice, void(const std::string&));
42 MOCK_METHOD2( 43 MOCK_METHOD2(
43 UnmountDeviceRecursively, 44 UnmountDeviceRecursively,
44 void(const std::string&, 45 void(const std::string&,
45 const DiskMountManager::UnmountDeviceRecursivelyCallbackType&)); 46 const DiskMountManager::UnmountDeviceRecursivelyCallbackType&));
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 82
82 // Is used to implement disks. 83 // Is used to implement disks.
83 const DiskMountManager::DiskMap& disksInternal() const { return disks_; } 84 const DiskMountManager::DiskMap& disksInternal() const { return disks_; }
84 85
85 const DiskMountManager::MountPointMap& mountPointsInternal() const; 86 const DiskMountManager::MountPointMap& mountPointsInternal() const;
86 87
87 // Returns Disk object associated with the |source_path| or NULL on failure. 88 // Returns Disk object associated with the |source_path| or NULL on failure.
88 const DiskMountManager::Disk* FindDiskBySourcePathInternal( 89 const DiskMountManager::Disk* FindDiskBySourcePathInternal(
89 const std::string& source_path) const; 90 const std::string& source_path) const;
90 91
92 // Is used to implement EnsureMountInfoRefreshed.
93 void EnsureMountInfoRefreshedInternal(
94 const EnsureMountInfoRefreshedCallback& callback);
95
91 // Notifies observers about device status update. 96 // Notifies observers about device status update.
92 void NotifyDeviceChanged(DeviceEvent event, 97 void NotifyDeviceChanged(DeviceEvent event,
93 const std::string& path); 98 const std::string& path);
94 99
95 // Notifies observers about disk status update. 100 // Notifies observers about disk status update.
96 void NotifyDiskChanged(DiskEvent event, 101 void NotifyDiskChanged(DiskEvent event,
97 const DiskMountManager::Disk* disk); 102 const DiskMountManager::Disk* disk);
98 103
99 // The list of observers. 104 // The list of observers.
100 ObserverList<DiskMountManager::Observer> observers_; 105 ObserverList<DiskMountManager::Observer> observers_;
101 106
102 // The list of disks found. 107 // The list of disks found.
103 DiskMountManager::DiskMap disks_; 108 DiskMountManager::DiskMap disks_;
104 109
105 // The list of existing mount points. 110 // The list of existing mount points.
106 DiskMountManager::MountPointMap mount_points_; 111 DiskMountManager::MountPointMap mount_points_;
107 112
108 DISALLOW_COPY_AND_ASSIGN(MockDiskMountManager); 113 DISALLOW_COPY_AND_ASSIGN(MockDiskMountManager);
109 }; 114 };
110 115
111 } // namespace disks 116 } // namespace disks
112 } // namespace chromeos 117 } // namespace chromeos
113 118
114 #endif // CHROMEOS_DISKS_MOCK_DISK_MOUNT_MANAGER_H_ 119 #endif // CHROMEOS_DISKS_MOCK_DISK_MOUNT_MANAGER_H_
OLDNEW
« no previous file with comments | « chromeos/disks/disk_mount_manager.cc ('k') | chromeos/disks/mock_disk_mount_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698