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 #ifndef COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_ | 5 #ifndef COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_ |
6 #define COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_ | 6 #define COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 class StorageMonitorWin : public StorageMonitor { | 23 class StorageMonitorWin : public StorageMonitor { |
24 public: | 24 public: |
25 // Should only be called by browser start up code. | 25 // Should only be called by browser start up code. |
26 // Use StorageMonitor::GetInstance() instead. | 26 // Use StorageMonitor::GetInstance() instead. |
27 // To support unit tests, this constructor takes |volume_mount_watcher| and | 27 // To support unit tests, this constructor takes |volume_mount_watcher| and |
28 // |portable_device_watcher| objects. These params are either constructed in | 28 // |portable_device_watcher| objects. These params are either constructed in |
29 // unit tests or in StorageMonitorWin CreateInternal() function. | 29 // unit tests or in StorageMonitorWin CreateInternal() function. |
30 StorageMonitorWin(VolumeMountWatcherWin* volume_mount_watcher, | 30 StorageMonitorWin(VolumeMountWatcherWin* volume_mount_watcher, |
31 PortableDeviceWatcherWin* portable_device_watcher); | 31 PortableDeviceWatcherWin* portable_device_watcher); |
32 virtual ~StorageMonitorWin(); | 32 ~StorageMonitorWin() override; |
33 | 33 |
34 // Must be called after the file thread is created. | 34 // Must be called after the file thread is created. |
35 virtual void Init() override; | 35 void Init() override; |
36 | 36 |
37 // StorageMonitor: | 37 // StorageMonitor: |
38 virtual bool GetStorageInfoForPath(const base::FilePath& path, | 38 bool GetStorageInfoForPath(const base::FilePath& path, |
39 StorageInfo* device_info) const override; | 39 StorageInfo* device_info) const override; |
40 virtual bool GetMTPStorageInfoFromDeviceId( | 40 bool GetMTPStorageInfoFromDeviceId( |
41 const std::string& storage_device_id, | 41 const std::string& storage_device_id, |
42 base::string16* device_location, | 42 base::string16* device_location, |
43 base::string16* storage_object_id) const override; | 43 base::string16* storage_object_id) const override; |
44 | 44 |
45 virtual void EjectDevice( | 45 void EjectDevice( |
46 const std::string& device_id, | 46 const std::string& device_id, |
47 base::Callback<void(EjectStatus)> callback) override; | 47 base::Callback<void(EjectStatus)> callback) override; |
48 | 48 |
49 private: | 49 private: |
50 class PortableDeviceNotifications; | 50 class PortableDeviceNotifications; |
51 friend class TestStorageMonitorWin; | 51 friend class TestStorageMonitorWin; |
52 | 52 |
53 void MediaChangeNotificationRegister(); | 53 void MediaChangeNotificationRegister(); |
54 | 54 |
55 // Gets the removable storage information given a |device_path|. On success, | 55 // Gets the removable storage information given a |device_path|. On success, |
(...skipping 26 matching lines...) Expand all Loading... |
82 // The portable device watcher, used to manage media transfer protocol | 82 // The portable device watcher, used to manage media transfer protocol |
83 // devices. | 83 // devices. |
84 scoped_ptr<PortableDeviceWatcherWin> portable_device_watcher_; | 84 scoped_ptr<PortableDeviceWatcherWin> portable_device_watcher_; |
85 | 85 |
86 DISALLOW_COPY_AND_ASSIGN(StorageMonitorWin); | 86 DISALLOW_COPY_AND_ASSIGN(StorageMonitorWin); |
87 }; | 87 }; |
88 | 88 |
89 } // namespace storage_monitor | 89 } // namespace storage_monitor |
90 | 90 |
91 #endif // COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_ | 91 #endif // COMPONENTS_STORAGE_MONITOR_STORAGE_MONITOR_WIN_H_ |
OLD | NEW |