| 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" |
| 11 #include "base/system_monitor/system_monitor.h" | |
| 12 #include "chrome/browser/system_monitor/removable_storage_notifications.h" | 11 #include "chrome/browser/system_monitor/removable_storage_notifications.h" |
| 13 | 12 |
| 14 class FilePath; | 13 class FilePath; |
| 15 | 14 |
| 16 namespace chrome { | 15 namespace chrome { |
| 17 | 16 |
| 18 class PortableDeviceWatcherWin; | 17 class PortableDeviceWatcherWin; |
| 19 class VolumeMountWatcherWin; | 18 class VolumeMountWatcherWin; |
| 20 | 19 |
| 21 class RemovableDeviceNotificationsWindowWin | 20 class RemovableDeviceNotificationsWindowWin |
| 22 : public RemovableStorageNotifications { | 21 : public RemovableStorageNotifications { |
| 23 public: | 22 public: |
| 24 // Creates an instance of RemovableDeviceNotificationsWindowWin. Should only | 23 // Creates an instance of RemovableDeviceNotificationsWindowWin. Should only |
| 25 // be called by browser start up code. Use GetInstance() instead. | 24 // be called by browser start up code. Use GetInstance() instead. |
| 26 static RemovableDeviceNotificationsWindowWin* Create(); | 25 static RemovableDeviceNotificationsWindowWin* Create(); |
| 27 | 26 |
| 28 virtual ~RemovableDeviceNotificationsWindowWin(); | 27 virtual ~RemovableDeviceNotificationsWindowWin(); |
| 29 | 28 |
| 30 // Must be called after the file thread is created. | 29 // Must be called after the file thread is created. |
| 31 void Init(); | 30 void Init(); |
| 32 | 31 |
| 33 // Finds the device that contains |path| and populates |device_info|. | 32 // Finds the device that contains |path| and populates |device_info|. |
| 34 // Returns false if unable to find the device. | 33 // 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 StorageInfo* device_info) const OVERRIDE; |
| 38 | 37 |
| 39 virtual uint64 GetStorageSize(const std::string& location) const OVERRIDE; | 38 virtual uint64 GetStorageSize(const std::string& location) const OVERRIDE; |
| 40 | 39 |
| 41 private: | 40 private: |
| 42 class PortableDeviceNotifications; | 41 class PortableDeviceNotifications; |
| 43 friend class TestRemovableDeviceNotificationsWindowWin; | 42 friend class TestRemovableDeviceNotificationsWindowWin; |
| 44 | 43 |
| 45 // To support unit tests, this constructor takes |volume_mount_watcher| and | 44 // To support unit tests, this constructor takes |volume_mount_watcher| and |
| 46 // |portable_device_watcher| objects. These params are either constructed in | 45 // |portable_device_watcher| objects. These params are either constructed in |
| 47 // unit tests or in RemovableDeviceNotificationsWindowWin::Create() function. | 46 // unit tests or in RemovableDeviceNotificationsWindowWin::Create() function. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // The portable device watcher, used to manage media transfer protocol | 78 // The portable device watcher, used to manage media transfer protocol |
| 80 // devices. | 79 // devices. |
| 81 scoped_ptr<PortableDeviceWatcherWin> portable_device_watcher_; | 80 scoped_ptr<PortableDeviceWatcherWin> portable_device_watcher_; |
| 82 | 81 |
| 83 DISALLOW_COPY_AND_ASSIGN(RemovableDeviceNotificationsWindowWin); | 82 DISALLOW_COPY_AND_ASSIGN(RemovableDeviceNotificationsWindowWin); |
| 84 }; | 83 }; |
| 85 | 84 |
| 86 } // namespace chrome | 85 } // namespace chrome |
| 87 | 86 |
| 88 #endif // CHROME_BROWSER_SYSTEM_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_WINDOW_W
IN_H_ | 87 #endif // CHROME_BROWSER_SYSTEM_MONITOR_REMOVABLE_DEVICE_NOTIFICATIONS_WINDOW_W
IN_H_ |
| OLD | NEW |