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

Unified Diff: chrome/browser/storage_monitor/removable_device_notifications_linux.cc

Issue 12334096: Regularize ownerships and lifecycle for storage monitor platform classes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: in progress... changed to not require mtp manager in linux for tests. Created 7 years, 10 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/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 b6767b29b2b67c830dd78b1dcb2654af5ff4f148..c3fbb01cdbac5b752bb72f8418c3baa66ea4875c 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,10 @@
#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"
namespace chrome {
@@ -253,6 +256,12 @@ void RemovableDeviceNotificationsLinux::Init() {
BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
base::Bind(&RemovableDeviceNotificationsLinux::InitOnFileThread, this));
+
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) {
+ media_transfer_protocol_device_observer_.reset(
+ new MediaTransferProtocolDeviceObserverLinux());
+ media_transfer_protocol_device_observer_->SetNotifications(receiver());
+ }
}
bool RemovableDeviceNotificationsLinux::GetStorageInfoForPath(

Powered by Google App Engine
This is Rietveld 408576698