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

Side by Side Diff: chrome/browser/chrome_browser_main_linux.cc

Issue 12147002: Add a receiver interface to RemovableStorageNotifications. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merging 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_main_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chrome_browser_main_linux.h" 5 #include "chrome/browser/chrome_browser_main_linux.h"
6 6
7 #include "base/message_loop_proxy.h" 7 #include "base/message_loop_proxy.h"
8 #include "chrome/browser/system_monitor/media_transfer_protocol_device_observer_ linux.h" 8 #include "chrome/browser/system_monitor/media_transfer_protocol_device_observer_ linux.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
10 #include "device/media_transfer_protocol/media_transfer_protocol_manager.h" 10 #include "device/media_transfer_protocol/media_transfer_protocol_manager.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 content::BrowserThread::FILE); 145 content::BrowserThread::FILE);
146 #endif 146 #endif
147 device::MediaTransferProtocolManager::Initialize(loop_proxy); 147 device::MediaTransferProtocolManager::Initialize(loop_proxy);
148 initialized_media_transfer_protocol_manager_ = true; 148 initialized_media_transfer_protocol_manager_ = true;
149 } 149 }
150 150
151 ChromeBrowserMainPartsPosix::PreProfileInit(); 151 ChromeBrowserMainPartsPosix::PreProfileInit();
152 } 152 }
153 153
154 void ChromeBrowserMainPartsLinux::PostProfileInit() { 154 void ChromeBrowserMainPartsLinux::PostProfileInit() {
155 // TODO(gbillock): Make this owned by RemovableDeviceNotificationsLinux.
155 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) { 156 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) {
156 media_transfer_protocol_device_observer_.reset( 157 media_transfer_protocol_device_observer_.reset(
157 new chrome::MediaTransferProtocolDeviceObserverLinux()); 158 new chrome::MediaTransferProtocolDeviceObserverLinux());
159 media_transfer_protocol_device_observer_->SetNotifications(
160 chrome::RemovableStorageNotifications::GetInstance()->receiver());
158 } 161 }
159 162
160 ChromeBrowserMainPartsPosix::PostProfileInit(); 163 ChromeBrowserMainPartsPosix::PostProfileInit();
161 } 164 }
162 165
163 void ChromeBrowserMainPartsLinux::PostMainMessageLoopRun() { 166 void ChromeBrowserMainPartsLinux::PostMainMessageLoopRun() {
164 #if !defined(OS_CHROMEOS) 167 #if !defined(OS_CHROMEOS)
165 // Release it now. Otherwise the FILE thread would be gone when we try to 168 // Release it now. Otherwise the FILE thread would be gone when we try to
166 // release it in the dtor and Valgrind would report a leak on almost ever 169 // release it in the dtor and Valgrind would report a leak on almost ever
167 // single browser_test. 170 // single browser_test.
168 removable_device_notifications_linux_ = NULL; 171 removable_device_notifications_linux_ = NULL;
169 #endif 172 #endif
170 173
171 media_transfer_protocol_device_observer_.reset(); 174 media_transfer_protocol_device_observer_.reset();
172 175
173 ChromeBrowserMainPartsPosix::PostMainMessageLoopRun(); 176 ChromeBrowserMainPartsPosix::PostMainMessageLoopRun();
174 } 177 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_main_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698