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

Unified Diff: chrome/browser/chrome_browser_main_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: Fix mac CF Ref check 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/chrome_browser_main_linux.cc
diff --git a/chrome/browser/chrome_browser_main_linux.cc b/chrome/browser/chrome_browser_main_linux.cc
index d7d1c2cbf96a89da05760be962510a10970bb65f..ddf507aac5f0068bcfce91f777d8822cc9b34895 100644
--- a/chrome/browser/chrome_browser_main_linux.cc
+++ b/chrome/browser/chrome_browser_main_linux.cc
@@ -4,11 +4,6 @@
#include "chrome/browser/chrome_browser_main_linux.h"
-#include "base/message_loop_proxy.h"
-#include "chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.h"
-#include "chrome/common/chrome_switches.h"
-#include "device/media_transfer_protocol/media_transfer_protocol_manager.h"
-
#if !defined(OS_CHROMEOS)
#include "chrome/browser/storage_monitor/removable_device_notifications_linux.h"
#include "content/public/browser/browser_thread.h"
@@ -21,6 +16,7 @@
#include "base/linux_util.h"
#include "base/prefs/pref_service.h"
#include "chrome/app/breakpad_linux.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/env_vars.h"
#include "chrome/common/pref_names.h"
@@ -108,13 +104,10 @@ bool IsCrashReportingEnabled(const PrefService* local_state) {
ChromeBrowserMainPartsLinux::ChromeBrowserMainPartsLinux(
const content::MainFunctionParams& parameters)
- : ChromeBrowserMainPartsPosix(parameters),
- initialized_media_transfer_protocol_manager_(false) {
+ : ChromeBrowserMainPartsPosix(parameters) {
}
ChromeBrowserMainPartsLinux::~ChromeBrowserMainPartsLinux() {
- if (initialized_media_transfer_protocol_manager_)
- device::MediaTransferProtocolManager::Shutdown();
}
void ChromeBrowserMainPartsLinux::PreProfileInit() {
@@ -135,30 +128,15 @@ void ChromeBrowserMainPartsLinux::PreProfileInit() {
const base::FilePath kDefaultMtabPath("/etc/mtab");
removable_device_notifications_linux_ =
new chrome::RemovableDeviceNotificationsLinux(kDefaultMtabPath);
- removable_device_notifications_linux_->Init();
#endif
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) {
- scoped_refptr<base::MessageLoopProxy> loop_proxy;
-#if !defined(OS_CHROMEOS)
- loop_proxy = content::BrowserThread::GetMessageLoopProxyForThread(
- content::BrowserThread::FILE);
-#endif
- device::MediaTransferProtocolManager::Initialize(loop_proxy);
- initialized_media_transfer_protocol_manager_ = true;
- }
-
ChromeBrowserMainPartsPosix::PreProfileInit();
}
void ChromeBrowserMainPartsLinux::PostProfileInit() {
- // TODO(gbillock): Make this owned by RemovableDeviceNotificationsLinux.
- if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) {
- media_transfer_protocol_device_observer_.reset(
- new chrome::MediaTransferProtocolDeviceObserverLinux());
- media_transfer_protocol_device_observer_->SetNotifications(
- chrome::StorageMonitor::GetInstance()->receiver());
- }
+#if !defined(OS_CHROMEOS)
+ removable_device_notifications_linux_->Init();
+#endif
ChromeBrowserMainPartsPosix::PostProfileInit();
}
@@ -171,7 +149,5 @@ void ChromeBrowserMainPartsLinux::PostMainMessageLoopRun() {
removable_device_notifications_linux_ = NULL;
#endif
- media_transfer_protocol_device_observer_.reset();
-
ChromeBrowserMainPartsPosix::PostMainMessageLoopRun();
}

Powered by Google App Engine
This is Rietveld 408576698