| 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/removable_device_notifications_mac.h" | 5 #include "chrome/browser/system_monitor/removable_device_notifications_mac.h" |
| 6 | 6 |
| 7 #include "content/public/browser/browser_thread.h" | 7 #include "content/public/browser/browser_thread.h" |
| 8 | 8 |
| 9 namespace chrome { | 9 namespace chrome { |
| 10 | 10 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 base::SystemMonitor::Get()->ProcessRemovableStorageDetached( | 105 base::SystemMonitor::Get()->ProcessRemovableStorageDetached( |
| 106 it->second.device_id()); | 106 it->second.device_id()); |
| 107 } | 107 } |
| 108 } | 108 } |
| 109 | 109 |
| 110 if (update_type == UPDATE_DEVICE_REMOVED) { | 110 if (update_type == UPDATE_DEVICE_REMOVED) { |
| 111 if (it != disk_info_map_.end()) | 111 if (it != disk_info_map_.end()) |
| 112 disk_info_map_.erase(it); | 112 disk_info_map_.erase(it); |
| 113 } else { | 113 } else { |
| 114 disk_info_map_[info.bsd_name()] = info; | 114 disk_info_map_[info.bsd_name()] = info; |
| 115 MediaStorageUtil::RecordDeviceInfoHistogram(true, info.device_id(), |
| 116 info.display_name()); |
| 115 if (ShouldPostNotificationForDisk(info)) { | 117 if (ShouldPostNotificationForDisk(info)) { |
| 116 base::SystemMonitor::Get()->ProcessRemovableStorageAttached( | 118 base::SystemMonitor::Get()->ProcessRemovableStorageAttached( |
| 117 info.device_id(), info.display_name(), info.mount_point().value()); | 119 info.device_id(), info.display_name(), info.mount_point().value()); |
| 118 } | 120 } |
| 119 } | 121 } |
| 120 } | 122 } |
| 121 | 123 |
| 122 bool RemovableDeviceNotificationsMac::GetDeviceInfoForPath( | 124 bool RemovableDeviceNotificationsMac::GetDeviceInfoForPath( |
| 123 const FilePath& path, | 125 const FilePath& path, |
| 124 base::SystemMonitor::RemovableStorageInfo* device_info) const { | 126 base::SystemMonitor::RemovableStorageInfo* device_info) const { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 it = disk_info_map_.begin(); it != disk_info_map_.end(); ++it) { | 196 it = disk_info_map_.begin(); it != disk_info_map_.end(); ++it) { |
| 195 if (it->second.mount_point() == mount_point) { | 197 if (it->second.mount_point() == mount_point) { |
| 196 *info = it->second; | 198 *info = it->second; |
| 197 return true; | 199 return true; |
| 198 } | 200 } |
| 199 } | 201 } |
| 200 return false; | 202 return false; |
| 201 } | 203 } |
| 202 | 204 |
| 203 } // namespace chrome | 205 } // namespace chrome |
| OLD | NEW |