OLD | NEW |
---|---|
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 "chrome/browser/system_monitor/media_transfer_protocol_device_observer_ linux.h" | 7 #include "chrome/browser/system_monitor/media_transfer_protocol_device_observer_ linux.h" |
8 #include "device/media_transfer_protocol/media_transfer_protocol_manager.h" | 8 #include "device/media_transfer_protocol/media_transfer_protocol_manager.h" |
9 | 9 |
10 #if !defined(OS_CHROMEOS) | 10 #if !defined(OS_CHROMEOS) |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
131 InitCrashReporter(); | 131 InitCrashReporter(); |
132 #endif | 132 #endif |
133 | 133 |
134 #if !defined(OS_CHROMEOS) | 134 #if !defined(OS_CHROMEOS) |
135 const FilePath kDefaultMtabPath("/etc/mtab"); | 135 const FilePath kDefaultMtabPath("/etc/mtab"); |
136 removable_device_notifications_linux_ = | 136 removable_device_notifications_linux_ = |
137 new chrome::RemovableDeviceNotificationsLinux(kDefaultMtabPath); | 137 new chrome::RemovableDeviceNotificationsLinux(kDefaultMtabPath); |
138 removable_device_notifications_linux_->Init(); | 138 removable_device_notifications_linux_->Init(); |
139 #endif | 139 #endif |
140 | 140 |
141 device::MediaTransferProtocolManager::Initialize(); | 141 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) { |
142 | 142 device::MediaTransferProtocolManager::Initialize(); |
143 did_pre_profile_init_ = true; | 143 did_pre_profile_init_ = true; |
Lei Zhang
2013/01/31 01:33:01
You have changed the meaning of this variable. In
kmadhusu
2013/01/31 02:30:40
Done.
| |
144 } | |
144 | 145 |
145 ChromeBrowserMainPartsPosix::PreProfileInit(); | 146 ChromeBrowserMainPartsPosix::PreProfileInit(); |
146 } | 147 } |
147 | 148 |
148 void ChromeBrowserMainPartsLinux::PostProfileInit() { | 149 void ChromeBrowserMainPartsLinux::PostProfileInit() { |
149 media_transfer_protocol_device_observer_.reset( | 150 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) { |
150 new chrome::MediaTransferProtocolDeviceObserverLinux()); | 151 media_transfer_protocol_device_observer_.reset( |
152 new chrome::MediaTransferProtocolDeviceObserverLinux()); | |
kmadhusu
2013/01/31 02:30:40
We don't need to instantiate MediaTransferProtocol
| |
153 } | |
151 | 154 |
152 ChromeBrowserMainPartsPosix::PostProfileInit(); | 155 ChromeBrowserMainPartsPosix::PostProfileInit(); |
153 } | 156 } |
154 | 157 |
155 void ChromeBrowserMainPartsLinux::PostMainMessageLoopRun() { | 158 void ChromeBrowserMainPartsLinux::PostMainMessageLoopRun() { |
156 #if !defined(OS_CHROMEOS) | 159 #if !defined(OS_CHROMEOS) |
157 // Release it now. Otherwise the FILE thread would be gone when we try to | 160 // Release it now. Otherwise the FILE thread would be gone when we try to |
158 // release it in the dtor and Valgrind would report a leak on almost ever | 161 // release it in the dtor and Valgrind would report a leak on almost ever |
159 // single browser_test. | 162 // single browser_test. |
160 removable_device_notifications_linux_ = NULL; | 163 removable_device_notifications_linux_ = NULL; |
161 #endif | 164 #endif |
162 | 165 |
163 media_transfer_protocol_device_observer_.reset(); | 166 media_transfer_protocol_device_observer_.reset(); |
164 | 167 |
165 ChromeBrowserMainPartsPosix::PostMainMessageLoopRun(); | 168 ChromeBrowserMainPartsPosix::PostMainMessageLoopRun(); |
166 } | 169 } |
OLD | NEW |