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

Unified Diff: chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.h

Issue 13533009: Storage Monitor: Remove MediaTransferProtocolDeviceObserverLinux::GetInstance() and access it only … (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase Created 7 years, 8 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/storage_monitor/media_transfer_protocol_device_observer_linux.h
===================================================================
--- chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.h (revision 192467)
+++ chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.h (working copy)
@@ -30,24 +30,19 @@
class MediaTransferProtocolDeviceObserverLinux
: public device::MediaTransferProtocolManager::Observer {
public:
- // Should only be called by browser start up code. Use GetInstance() instead.
- MediaTransferProtocolDeviceObserverLinux();
+ explicit MediaTransferProtocolDeviceObserverLinux(
+ StorageMonitor::Receiver* receiver);
virtual ~MediaTransferProtocolDeviceObserverLinux();
- static MediaTransferProtocolDeviceObserverLinux* GetInstance();
-
// Finds the storage that contains |path| and populates |storage_info|.
// Returns false if unable to find the storage.
bool GetStorageInfoForPath(const base::FilePath& path,
StorageInfo* storage_info) const;
- // Set the volume notifications object to be used when new
- // MTP devices are found.
- void SetNotifications(StorageMonitor::Receiver* notifications);
-
protected:
// Only used in unit tests.
- explicit MediaTransferProtocolDeviceObserverLinux(
+ MediaTransferProtocolDeviceObserverLinux(
+ StorageMonitor::Receiver* receiver,
GetStorageInfoFunc get_storage_info_func);
// device::MediaTransferProtocolManager::Observer implementation.
@@ -71,9 +66,7 @@
// The notifications object to use to signal newly attached devices.
// Guaranteed to outlive this class.
- // TODO(gbillock): Edit this when this class is owned by a
- // StorageMonitor subclass.
- StorageMonitor::Receiver* notifications_;
+ StorageMonitor::Receiver* const notifications_;
DISALLOW_COPY_AND_ASSIGN(MediaTransferProtocolDeviceObserverLinux);
};

Powered by Google App Engine
This is Rietveld 408576698