| 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 #ifndef CHROME_BROWSER_SYSTEM_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_WINDOW_WIN_
H_ | 5 #ifndef CHROME_BROWSER_SYSTEM_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_WINDOW_WIN_
H_ |
| 6 #define CHROME_BROWSER_SYSTEM_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_WINDOW_WIN_
H_ | 6 #define CHROME_BROWSER_SYSTEM_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_WINDOW_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 12 matching lines...) Expand all Loading... |
| 23 public: | 23 public: |
| 24 // Creates an instance of RemovableDeviceNotificationsWindowWin. Should only | 24 // Creates an instance of RemovableDeviceNotificationsWindowWin. Should only |
| 25 // be called by browser start up code. Use GetInstance() instead. | 25 // be called by browser start up code. Use GetInstance() instead. |
| 26 static RemovableDeviceNotificationsWindowWin* Create(); | 26 static RemovableDeviceNotificationsWindowWin* Create(); |
| 27 | 27 |
| 28 virtual ~RemovableDeviceNotificationsWindowWin(); | 28 virtual ~RemovableDeviceNotificationsWindowWin(); |
| 29 | 29 |
| 30 // Must be called after the file thread is created. | 30 // Must be called after the file thread is created. |
| 31 void Init(); | 31 void Init(); |
| 32 | 32 |
| 33 // Finds the device that contains |path| and populates |device_info|. | 33 // RemovableStorageNotifications: |
| 34 // Returns false if unable to find the device. | |
| 35 virtual bool GetDeviceInfoForPath( | 34 virtual bool GetDeviceInfoForPath( |
| 36 const FilePath& path, | 35 const FilePath& path, |
| 37 base::SystemMonitor::RemovableStorageInfo* device_info) const OVERRIDE; | 36 base::SystemMonitor::RemovableStorageInfo* device_info) const OVERRIDE; |
| 38 | |
| 39 virtual uint64 GetStorageSize(const std::string& location) const OVERRIDE; | 37 virtual uint64 GetStorageSize(const std::string& location) const OVERRIDE; |
| 38 virtual bool GetMTPStorageInfoFromDeviceId( |
| 39 const std::string& storage_device_id, |
| 40 string16* device_location, |
| 41 string16* storage_object_id) const OVERRIDE; |
| 40 | 42 |
| 41 private: | 43 private: |
| 42 class PortableDeviceNotifications; | 44 class PortableDeviceNotifications; |
| 43 friend class TestRemovableDeviceNotificationsWindowWin; | 45 friend class TestRemovableDeviceNotificationsWindowWin; |
| 44 | 46 |
| 45 // To support unit tests, this constructor takes |volume_mount_watcher| and | 47 // To support unit tests, this constructor takes |volume_mount_watcher| and |
| 46 // |portable_device_watcher| objects. These params are either constructed in | 48 // |portable_device_watcher| objects. These params are either constructed in |
| 47 // unit tests or in RemovableDeviceNotificationsWindowWin::Create() function. | 49 // unit tests or in RemovableDeviceNotificationsWindowWin::Create() function. |
| 48 RemovableDeviceNotificationsWindowWin( | 50 RemovableDeviceNotificationsWindowWin( |
| 49 VolumeMountWatcherWin* volume_mount_watcher, | 51 VolumeMountWatcherWin* volume_mount_watcher, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 79 // The portable device watcher, used to manage media transfer protocol | 81 // The portable device watcher, used to manage media transfer protocol |
| 80 // devices. | 82 // devices. |
| 81 scoped_ptr<PortableDeviceWatcherWin> portable_device_watcher_; | 83 scoped_ptr<PortableDeviceWatcherWin> portable_device_watcher_; |
| 82 | 84 |
| 83 DISALLOW_COPY_AND_ASSIGN(RemovableDeviceNotificationsWindowWin); | 85 DISALLOW_COPY_AND_ASSIGN(RemovableDeviceNotificationsWindowWin); |
| 84 }; | 86 }; |
| 85 | 87 |
| 86 } // namespace chrome | 88 } // namespace chrome |
| 87 | 89 |
| 88 #endif // CHROME_BROWSER_SYSTEM_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_WINDOW_W
IN_H_ | 90 #endif // CHROME_BROWSER_SYSTEM_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_WINDOW_W
IN_H_ |
| OLD | NEW |