Index: chrome/browser/storage_monitor/removable_device_notifications_linux.cc |
diff --git a/chrome/browser/storage_monitor/removable_device_notifications_linux.cc b/chrome/browser/storage_monitor/removable_device_notifications_linux.cc |
index db6ef69c67d59aeb18271830f24244a9dd3a3ac4..8d558826dd23b7709ef259636aec7446151ffe4a 100644 |
--- a/chrome/browser/storage_monitor/removable_device_notifications_linux.cc |
+++ b/chrome/browser/storage_monitor/removable_device_notifications_linux.cc |
@@ -13,6 +13,7 @@ |
#include "base/basictypes.h" |
#include "base/bind.h" |
+#include "base/command_line.h" |
#include "base/files/file_path.h" |
#include "base/metrics/histogram.h" |
#include "base/stl_util.h" |
@@ -21,8 +22,11 @@ |
#include "base/utf_string_conversions.h" |
#include "chrome/browser/storage_monitor/media_device_notifications_utils.h" |
#include "chrome/browser/storage_monitor/media_storage_util.h" |
+#include "chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.h" |
#include "chrome/browser/storage_monitor/removable_device_constants.h" |
#include "chrome/browser/storage_monitor/udev_util_linux.h" |
+#include "chrome/common/chrome_switches.h" |
+#include "device/media_transfer_protocol/media_transfer_protocol_manager.h" |
namespace chrome { |
@@ -241,6 +245,7 @@ RemovableDeviceNotificationsLinux::RemovableDeviceNotificationsLinux( |
RemovableDeviceNotificationsLinux::~RemovableDeviceNotificationsLinux() { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
+ device::MediaTransferProtocolManager::Shutdown(); |
Lei Zhang
2013/03/01 04:40:15
ditto
Greg Billock
2013/03/01 18:00:50
Done.
|
} |
void RemovableDeviceNotificationsLinux::Init() { |
@@ -253,6 +258,17 @@ void RemovableDeviceNotificationsLinux::Init() { |
BrowserThread::PostTask( |
BrowserThread::FILE, FROM_HERE, |
base::Bind(&RemovableDeviceNotificationsLinux::InitOnFileThread, this)); |
+ |
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) { |
+ scoped_refptr<base::MessageLoopProxy> loop_proxy; |
+ loop_proxy = content::BrowserThread::GetMessageLoopProxyForThread( |
+ content::BrowserThread::FILE); |
+ device::MediaTransferProtocolManager::Initialize(loop_proxy); |
+ |
+ media_transfer_protocol_device_observer_.reset( |
+ new MediaTransferProtocolDeviceObserverLinux()); |
+ media_transfer_protocol_device_observer_->SetNotifications(receiver()); |
+ } |
} |
bool RemovableDeviceNotificationsLinux::GetStorageInfoForPath( |