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

Unified Diff: chrome/browser/chromeos/cros/mount_library.h

Issue 1142005: Mocks for all libcros elements (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/cros/mount_library.h
===================================================================
--- chrome/browser/chromeos/cros/mount_library.h (revision 42341)
+++ chrome/browser/chromeos/cros/mount_library.h (working copy)
@@ -45,22 +45,29 @@
const std::string& path) = 0;
};
- // This gets the singleton MountLibrary
- static MountLibrary* Get();
+ virtual ~MountLibrary() {}
+ virtual void AddObserver(Observer* observer) = 0;
+ virtual void RemoveObserver(Observer* observer) = 0;
+ virtual const DiskVector& disks() const = 0;
+};
- void AddObserver(Observer* observer);
- void RemoveObserver(Observer* observer);
- const DiskVector& disks() const { return disks_; }
+// This class handles the interaction with the ChromeOS mount library APIs.
+// Classes can add themselves as observers. Users can get an instance of this
+// library class like this: MountLibrary::Get().
+class MountLibraryImpl : public MountLibrary {
+ public:
+ MountLibraryImpl();
+ virtual ~MountLibraryImpl();
+ // MountLibrary overrides.
+ virtual void AddObserver(Observer* observer);
+ virtual void RemoveObserver(Observer* observer);
+ virtual const DiskVector& disks() const { return disks_; }
+
private:
- friend struct DefaultSingletonTraits<MountLibrary>;
-
void ParseDisks(const MountStatus& status);
- MountLibrary();
- ~MountLibrary();
-
// This method is called when there's a change in mount status.
// This method is called the UI Thread.
static void MountStatusChangedHandler(void* object,
@@ -87,7 +94,7 @@
// The list of disks found.
DiskVector disks_;
- DISALLOW_COPY_AND_ASSIGN(MountLibrary);
+ DISALLOW_COPY_AND_ASSIGN(MountLibraryImpl);
};
} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/cros/mock_synaptics_library.h ('k') | chrome/browser/chromeos/cros/mount_library.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698