| 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/system_monitor/volume_mount_watcher_win.h" | 5 #include "chrome/browser/system_monitor/volume_mount_watcher_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <dbt.h> | 8 #include <dbt.h> |
| 9 #include <fileapi.h> | 9 #include <fileapi.h> |
| 10 | 10 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 namespace chrome { | 100 namespace chrome { |
| 101 | 101 |
| 102 VolumeMountWatcherWin::VolumeMountWatcherWin() { | 102 VolumeMountWatcherWin::VolumeMountWatcherWin() { |
| 103 } | 103 } |
| 104 | 104 |
| 105 void VolumeMountWatcherWin::Init() { | 105 void VolumeMountWatcherWin::Init() { |
| 106 // When VolumeMountWatcherWin is created, the message pumps are not running | 106 // When VolumeMountWatcherWin is created, the message pumps are not running |
| 107 // so a posted task from the constructor would never run. Therefore, do all | 107 // so a posted task from the constructor would never run. Therefore, do all |
| 108 // the initializations here. | 108 // the initializations here. |
| 109 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, base::Bind( | 109 // |
| 110 &VolumeMountWatcherWin::AddExistingDevicesOnFileThread, this)); | 110 // This should call AddExistingDevicesOnFileThread. The call is disabled |
| 111 // until a fix for http://crbug.com/155910 can land. |
| 112 // BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, base::Bind( |
| 113 // &VolumeMountWatcherWin::AddExistingDevicesOnFileThread, this)); |
| 111 } | 114 } |
| 112 | 115 |
| 113 bool VolumeMountWatcherWin::GetDeviceInfo(const FilePath& device_path, | 116 bool VolumeMountWatcherWin::GetDeviceInfo(const FilePath& device_path, |
| 114 string16* device_location, std::string* unique_id, string16* name, | 117 string16* device_location, std::string* unique_id, string16* name, |
| 115 bool* removable) { | 118 bool* removable) { |
| 116 return GetDeviceDetails(device_path, device_location, unique_id, name, | 119 return GetDeviceDetails(device_path, device_location, unique_id, name, |
| 117 removable); | 120 removable); |
| 118 } | 121 } |
| 119 | 122 |
| 120 void VolumeMountWatcherWin::OnWindowMessage(UINT event_type, LPARAM data) { | 123 void VolumeMountWatcherWin::OnWindowMessage(UINT event_type, LPARAM data) { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 if (device_info == device_ids_.end()) | 240 if (device_info == device_ids_.end()) |
| 238 return; | 241 return; |
| 239 | 242 |
| 240 SystemMonitor* monitor = SystemMonitor::Get(); | 243 SystemMonitor* monitor = SystemMonitor::Get(); |
| 241 if (monitor) | 244 if (monitor) |
| 242 monitor->ProcessRemovableStorageDetached(device_info->second); | 245 monitor->ProcessRemovableStorageDetached(device_info->second); |
| 243 device_ids_.erase(device_info); | 246 device_ids_.erase(device_info); |
| 244 } | 247 } |
| 245 | 248 |
| 246 } // namespace chrome | 249 } // namespace chrome |
| OLD | NEW |