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" |
11 | 11 |
12 namespace storage_monitor { | 12 namespace storage_monitor { |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 StorageMonitor* g_storage_monitor = NULL; | 16 StorageMonitor* g_storage_monitor = NULL; |
17 | 17 |
18 } // namespace | 18 } // namespace |
19 | 19 |
20 StorageMonitor::Receiver::~Receiver() { | 20 StorageMonitor::Receiver::~Receiver() { |
21 } | 21 } |
22 | 22 |
23 class StorageMonitor::ReceiverImpl : public StorageMonitor::Receiver { | 23 class StorageMonitor::ReceiverImpl : public StorageMonitor::Receiver { |
24 public: | 24 public: |
25 explicit ReceiverImpl(StorageMonitor* notifications) | 25 explicit ReceiverImpl(StorageMonitor* notifications) |
26 : notifications_(notifications) {} | 26 : notifications_(notifications) {} |
27 | 27 |
28 virtual ~ReceiverImpl() {} | 28 virtual ~ReceiverImpl() {} |
29 | 29 |
30 virtual void ProcessAttach(const StorageInfo& info) OVERRIDE; | 30 virtual void ProcessAttach(const StorageInfo& info) override; |
31 | 31 |
32 virtual void ProcessDetach(const std::string& id) OVERRIDE; | 32 virtual void ProcessDetach(const std::string& id) override; |
33 | 33 |
34 virtual void MarkInitialized() OVERRIDE; | 34 virtual void MarkInitialized() override; |
35 | 35 |
36 private: | 36 private: |
37 StorageMonitor* notifications_; | 37 StorageMonitor* notifications_; |
38 }; | 38 }; |
39 | 39 |
40 void StorageMonitor::ReceiverImpl::ProcessAttach(const StorageInfo& info) { | 40 void StorageMonitor::ReceiverImpl::ProcessAttach(const StorageInfo& info) { |
41 notifications_->ProcessAttach(info); | 41 notifications_->ProcessAttach(info); |
42 } | 42 } |
43 | 43 |
44 void StorageMonitor::ReceiverImpl::ProcessDetach(const std::string& id) { | 44 void StorageMonitor::ReceiverImpl::ProcessDetach(const std::string& id) { |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 } | 188 } |
189 | 189 |
190 DVLOG(1) << "StorageDetached for id " << id; | 190 DVLOG(1) << "StorageDetached for id " << id; |
191 if (StorageInfo::IsRemovableDevice(info.device_id())) { | 191 if (StorageInfo::IsRemovableDevice(info.device_id())) { |
192 observer_list_->Notify( | 192 observer_list_->Notify( |
193 &RemovableStorageObserver::OnRemovableStorageDetached, info); | 193 &RemovableStorageObserver::OnRemovableStorageDetached, info); |
194 } | 194 } |
195 } | 195 } |
196 | 196 |
197 } // namespace storage_monitor | 197 } // namespace storage_monitor |
OLD | NEW |