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

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

Issue 11365142: Small refactoring in DiskMountManager (event reporting; format method). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: few lint nits Created 8 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 | Annotate | Revision Log
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 15 matching lines...) Expand all
26 MOCK_METHOD1(RemoveObserver, void(DiskMountManager::Observer*)); 26 MOCK_METHOD1(RemoveObserver, void(DiskMountManager::Observer*));
27 MOCK_CONST_METHOD0(disks, const DiskMountManager::DiskMap&(void)); 27 MOCK_CONST_METHOD0(disks, const DiskMountManager::DiskMap&(void));
28 MOCK_CONST_METHOD1(FindDiskBySourcePath, 28 MOCK_CONST_METHOD1(FindDiskBySourcePath,
29 const DiskMountManager::Disk*(const std::string&)); 29 const DiskMountManager::Disk*(const std::string&));
30 MOCK_CONST_METHOD0(mount_points, 30 MOCK_CONST_METHOD0(mount_points,
31 const DiskMountManager::MountPointMap&(void)); 31 const DiskMountManager::MountPointMap&(void));
32 MOCK_METHOD0(RequestMountInfoRefresh, void(void)); 32 MOCK_METHOD0(RequestMountInfoRefresh, void(void));
33 MOCK_METHOD4(MountPath, void(const std::string&, const std::string&, 33 MOCK_METHOD4(MountPath, void(const std::string&, const std::string&,
34 const std::string&, MountType)); 34 const std::string&, MountType));
35 MOCK_METHOD2(UnmountPath, void(const std::string&, UnmountOptions)); 35 MOCK_METHOD2(UnmountPath, void(const std::string&, UnmountOptions));
36 MOCK_METHOD1(FormatUnmountedDevice, void(const std::string&));
37 MOCK_METHOD1(FormatMountedDevice, void(const std::string&)); 36 MOCK_METHOD1(FormatMountedDevice, void(const std::string&));
38 MOCK_METHOD3(UnmountDeviceRecursive, void(const std::string&, 37 MOCK_METHOD3(UnmountDeviceRecursive, void(const std::string&,
39 DiskMountManager::UnmountDeviceRecursiveCallbackType, void*)); 38 DiskMountManager::UnmountDeviceRecursiveCallbackType, void*));
40 39
41 // Invokes fake device insert events. 40 // Invokes fake device insert events.
42 void NotifyDeviceInsertEvents(); 41 void NotifyDeviceInsertEvents();
43 42
44 // Invokes fake device remove events. 43 // Invokes fake device remove events.
45 void NotifyDeviceRemoveEvents(); 44 void NotifyDeviceRemoveEvents();
46 45
(...skipping 22 matching lines...) Expand all
69 // Is used to implement disks. 68 // Is used to implement disks.
70 const DiskMountManager::DiskMap& disksInternal() const { return disks_; } 69 const DiskMountManager::DiskMap& disksInternal() const { return disks_; }
71 70
72 const DiskMountManager::MountPointMap& mountPointsInternal() const; 71 const DiskMountManager::MountPointMap& mountPointsInternal() const;
73 72
74 // Returns Disk object associated with the |source_path| or NULL on failure. 73 // Returns Disk object associated with the |source_path| or NULL on failure.
75 const DiskMountManager::Disk* FindDiskBySourcePathInternal( 74 const DiskMountManager::Disk* FindDiskBySourcePathInternal(
76 const std::string& source_path) const; 75 const std::string& source_path) const;
77 76
78 // Notifies observers about device status update. 77 // Notifies observers about device status update.
79 void NotifyDeviceChanged(DiskMountManagerEventType event, 78 void NotifyDeviceChanged(DeviceEvent event,
80 const std::string& path); 79 const std::string& path);
81 80
82 // Notifies observers about disk status update. 81 // Notifies observers about disk status update.
83 void NotifyDiskChanged(DiskMountManagerEventType event, 82 void NotifyDiskChanged(DiskEvent event,
84 const DiskMountManager::Disk* disk); 83 const DiskMountManager::Disk* disk);
85 84
86 // The list of observers. 85 // The list of observers.
87 ObserverList<DiskMountManager::Observer> observers_; 86 ObserverList<DiskMountManager::Observer> observers_;
88 87
89 // The list of disks found. 88 // The list of disks found.
90 DiskMountManager::DiskMap disks_; 89 DiskMountManager::DiskMap disks_;
91 90
92 // The list of existing mount points. 91 // The list of existing mount points.
93 DiskMountManager::MountPointMap mount_points_; 92 DiskMountManager::MountPointMap mount_points_;
94 93
95 DISALLOW_COPY_AND_ASSIGN(MockDiskMountManager); 94 DISALLOW_COPY_AND_ASSIGN(MockDiskMountManager);
96 }; 95 };
97 96
98 } // namespace disks 97 } // namespace disks
99 } // namespace chromeos 98 } // namespace chromeos
100 99
101 #endif // CHROMEOS_DISKS_MOCK_DISK_MOUNT_MANAGER_H_ 100 #endif // CHROMEOS_DISKS_MOCK_DISK_MOUNT_MANAGER_H_
OLDNEW
« no previous file with comments | « chromeos/disks/disk_mount_manager_unittest.cc ('k') | chromeos/disks/mock_disk_mount_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698