| 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/storage_monitor/removable_device_notifications_mac.h" | 5 #include "chrome/browser/storage_monitor/removable_device_notifications_mac.h" |
| 6 | 6 |
| 7 #include "base/mac/mac_util.h" |
| 8 #include "chrome/browser/storage_monitor/image_capture_device_manager.h" |
| 7 #include "chrome/browser/storage_monitor/media_device_notifications_utils.h" | 9 #include "chrome/browser/storage_monitor/media_device_notifications_utils.h" |
| 8 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| 9 | 11 |
| 10 namespace chrome { | 12 namespace chrome { |
| 11 | 13 |
| 12 namespace { | 14 namespace { |
| 13 | 15 |
| 14 const char kDiskImageModelName[] = "Disk Image"; | 16 const char kDiskImageModelName[] = "Disk Image"; |
| 15 | 17 |
| 16 void GetDiskInfoAndUpdateOnFileThread( | 18 void GetDiskInfoAndUpdateOnFileThread( |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 session_, | 65 session_, |
| 64 kDADiskDescriptionMatchVolumeMountable, | 66 kDADiskDescriptionMatchVolumeMountable, |
| 65 DiskDisappearedCallback, | 67 DiskDisappearedCallback, |
| 66 this); | 68 this); |
| 67 DARegisterDiskDescriptionChangedCallback( | 69 DARegisterDiskDescriptionChangedCallback( |
| 68 session_, | 70 session_, |
| 69 kDADiskDescriptionMatchVolumeMountable, | 71 kDADiskDescriptionMatchVolumeMountable, |
| 70 kDADiskDescriptionWatchVolumePath, | 72 kDADiskDescriptionWatchVolumePath, |
| 71 DiskDescriptionChangedCallback, | 73 DiskDescriptionChangedCallback, |
| 72 this); | 74 this); |
| 75 |
| 76 if (base::mac::IsOSLionOrLater()) { |
| 77 image_capture_device_manager_.reset(new chrome::ImageCaptureDeviceManager); |
| 78 image_capture_device_manager_->SetNotifications(receiver()); |
| 79 } |
| 73 } | 80 } |
| 74 | 81 |
| 75 RemovableDeviceNotificationsMac::~RemovableDeviceNotificationsMac() { | 82 RemovableDeviceNotificationsMac::~RemovableDeviceNotificationsMac() { |
| 76 DASessionUnscheduleFromRunLoop( | 83 DASessionUnscheduleFromRunLoop( |
| 77 session_, CFRunLoopGetCurrent(), kCFRunLoopCommonModes); | 84 session_, CFRunLoopGetCurrent(), kCFRunLoopCommonModes); |
| 78 } | 85 } |
| 79 | 86 |
| 80 void RemovableDeviceNotificationsMac::UpdateDisk( | 87 void RemovableDeviceNotificationsMac::UpdateDisk( |
| 81 const DiskInfoMac& info, | 88 const DiskInfoMac& info, |
| 82 UpdateType update_type) { | 89 UpdateType update_type) { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 it = disk_info_map_.begin(); it != disk_info_map_.end(); ++it) { | 201 it = disk_info_map_.begin(); it != disk_info_map_.end(); ++it) { |
| 195 if (it->second.mount_point() == mount_point) { | 202 if (it->second.mount_point() == mount_point) { |
| 196 *info = it->second; | 203 *info = it->second; |
| 197 return true; | 204 return true; |
| 198 } | 205 } |
| 199 } | 206 } |
| 200 return false; | 207 return false; |
| 201 } | 208 } |
| 202 | 209 |
| 203 } // namespace chrome | 210 } // namespace chrome |
| OLD | NEW |