Index: chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.cc |
=================================================================== |
--- chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.cc (revision 192467) |
+++ chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.cc (working copy) |
@@ -4,6 +4,8 @@ |
#include "chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.h" |
+#include <vector> |
+ |
#include "base/files/file_path.h" |
#include "base/stl_util.h" |
#include "base/strings/string_number_conversions.h" |
@@ -120,8 +122,9 @@ |
} // namespace |
MediaTransferProtocolDeviceObserverLinux:: |
-MediaTransferProtocolDeviceObserverLinux() |
- : get_storage_info_func_(&GetStorageInfo) { |
+MediaTransferProtocolDeviceObserverLinux(StorageMonitor::Receiver* receiver) |
+ : get_storage_info_func_(&GetStorageInfo), |
+ notifications_(receiver) { |
DCHECK(!g_mtp_device_observer); |
g_mtp_device_observer = this; |
@@ -135,9 +138,10 @@ |
// This constructor is only used by unit tests. |
MediaTransferProtocolDeviceObserverLinux:: |
MediaTransferProtocolDeviceObserverLinux( |
+ StorageMonitor::Receiver* receiver, |
GetStorageInfoFunc get_storage_info_func) |
: get_storage_info_func_(get_storage_info_func), |
- notifications_(NULL) { |
+ notifications_(receiver) { |
DCHECK(!g_mtp_device_observer); |
g_mtp_device_observer = this; |
} |
@@ -153,13 +157,6 @@ |
mtp_manager->RemoveObserver(this); |
} |
-// static |
-MediaTransferProtocolDeviceObserverLinux* |
-MediaTransferProtocolDeviceObserverLinux::GetInstance() { |
- DCHECK(g_mtp_device_observer != NULL); |
- return g_mtp_device_observer; |
-} |
- |
bool MediaTransferProtocolDeviceObserverLinux::GetStorageInfoForPath( |
const base::FilePath& path, |
StorageInfo* storage_info) const { |
@@ -184,11 +181,6 @@ |
return true; |
} |
-void MediaTransferProtocolDeviceObserverLinux::SetNotifications( |
- StorageMonitor::Receiver* notifications) { |
- notifications_ = notifications; |
-} |
- |
// device::MediaTransferProtocolManager::Observer override. |
void MediaTransferProtocolDeviceObserverLinux::StorageChanged( |
bool is_attached, |