| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/storage_monitor/storage_monitor.h" | 5 #include "components/storage_monitor/storage_monitor.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "components/storage_monitor/removable_storage_observer.h" | 9 #include "components/storage_monitor/removable_storage_observer.h" |
| 10 #include "components/storage_monitor/transient_device_ids.h" | 10 #include "components/storage_monitor/transient_device_ids.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 127 |
| 128 void StorageMonitor::EjectDevice( | 128 void StorageMonitor::EjectDevice( |
| 129 const std::string& device_id, | 129 const std::string& device_id, |
| 130 base::Callback<void(EjectStatus)> callback) { | 130 base::Callback<void(EjectStatus)> callback) { |
| 131 // Platform-specific implementations will override this method to | 131 // Platform-specific implementations will override this method to |
| 132 // perform actual device ejection. | 132 // perform actual device ejection. |
| 133 callback.Run(EJECT_FAILURE); | 133 callback.Run(EJECT_FAILURE); |
| 134 } | 134 } |
| 135 | 135 |
| 136 StorageMonitor::StorageMonitor() | 136 StorageMonitor::StorageMonitor() |
| 137 : observer_list_(new ObserverListThreadSafe<RemovableStorageObserver>()), | 137 : observer_list_( |
| 138 new base::ObserverListThreadSafe<RemovableStorageObserver>()), |
| 138 initializing_(false), | 139 initializing_(false), |
| 139 initialized_(false), | 140 initialized_(false), |
| 140 transient_device_ids_(new TransientDeviceIds) { | 141 transient_device_ids_(new TransientDeviceIds) { |
| 141 receiver_.reset(new ReceiverImpl(this)); | 142 receiver_.reset(new ReceiverImpl(this)); |
| 142 } | 143 } |
| 143 | 144 |
| 144 StorageMonitor::~StorageMonitor() { | 145 StorageMonitor::~StorageMonitor() { |
| 145 } | 146 } |
| 146 | 147 |
| 147 StorageMonitor::Receiver* StorageMonitor::receiver() const { | 148 StorageMonitor::Receiver* StorageMonitor::receiver() const { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 } | 189 } |
| 189 | 190 |
| 190 DVLOG(1) << "StorageDetached for id " << id; | 191 DVLOG(1) << "StorageDetached for id " << id; |
| 191 if (StorageInfo::IsRemovableDevice(info.device_id())) { | 192 if (StorageInfo::IsRemovableDevice(info.device_id())) { |
| 192 observer_list_->Notify( | 193 observer_list_->Notify( |
| 193 FROM_HERE, &RemovableStorageObserver::OnRemovableStorageDetached, info); | 194 FROM_HERE, &RemovableStorageObserver::OnRemovableStorageDetached, info); |
| 194 } | 195 } |
| 195 } | 196 } |
| 196 | 197 |
| 197 } // namespace storage_monitor | 198 } // namespace storage_monitor |
| OLD | NEW |