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

Unified Diff: chrome/browser/storage_monitor/removable_device_notifications_chromeos.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: 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_chromeos.cc
diff --git a/chrome/browser/storage_monitor/removable_device_notifications_chromeos.cc b/chrome/browser/storage_monitor/removable_device_notifications_chromeos.cc
index 7c679ce0aacbcf2dd7a3ff7b29d5dd296213b8a0..219f25cf76a92c7d6c1ef483f5fed7f123e62eed 100644
--- a/chrome/browser/storage_monitor/removable_device_notifications_chromeos.cc
+++ b/chrome/browser/storage_monitor/removable_device_notifications_chromeos.cc
@@ -6,6 +6,7 @@
#include "chrome/browser/storage_monitor/removable_device_notifications_chromeos.h"
+#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/stl_util.h"
@@ -14,7 +15,9 @@
#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/common/chrome_switches.h"
#include "content/public/browser/browser_thread.h"
namespace chromeos {
@@ -90,6 +93,12 @@ RemovableDeviceNotificationsCros::RemovableDeviceNotificationsCros() {
DCHECK(disks::DiskMountManager::GetInstance());
disks::DiskMountManager::GetInstance()->AddObserver(this);
CheckExistingMountPointsOnUIThread();
+
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) {
+ media_transfer_protocol_device_observer_.reset(
+ new chrome::MediaTransferProtocolDeviceObserverLinux());
+ media_transfer_protocol_device_observer_->SetNotifications(receiver());
+ }
}
RemovableDeviceNotificationsCros::~RemovableDeviceNotificationsCros() {

Powered by Google App Engine
This is Rietveld 408576698