| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_CHROMEOS_USB_MOUNT_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_USB_MOUNT_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_USB_MOUNT_OBSERVER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_USB_MOUNT_OBSERVER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // a new mounted usb device is found. | 25 // a new mounted usb device is found. |
| 26 class USBMountObserver : public chromeos::MountLibrary::Observer, | 26 class USBMountObserver : public chromeos::MountLibrary::Observer, |
| 27 public NotificationObserver { | 27 public NotificationObserver { |
| 28 public: | 28 public: |
| 29 struct BrowserWithPath { | 29 struct BrowserWithPath { |
| 30 Browser* browser; | 30 Browser* browser; |
| 31 std::string device_path; | 31 std::string device_path; |
| 32 std::string mount_path; | 32 std::string mount_path; |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 static USBMountObserver* Get(); | 35 static USBMountObserver* GetInstance(); |
| 36 | 36 |
| 37 void Observe(NotificationType type, | 37 void Observe(NotificationType type, |
| 38 const NotificationSource& source, | 38 const NotificationSource& source, |
| 39 const NotificationDetails& details); | 39 const NotificationDetails& details); |
| 40 | 40 |
| 41 void MountChanged(chromeos::MountLibrary* obj, | 41 void MountChanged(chromeos::MountLibrary* obj, |
| 42 chromeos::MountEventType evt, | 42 chromeos::MountEventType evt, |
| 43 const std::string& path); | 43 const std::string& path); |
| 44 | 44 |
| 45 void ScanForDevices(chromeos::MountLibrary* obj); | 45 void ScanForDevices(chromeos::MountLibrary* obj); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 61 bool small); | 61 bool small); |
| 62 | 62 |
| 63 std::vector<BrowserWithPath> browsers_; | 63 std::vector<BrowserWithPath> browsers_; |
| 64 NotificationRegistrar registrar_; | 64 NotificationRegistrar registrar_; |
| 65 | 65 |
| 66 DISALLOW_COPY_AND_ASSIGN(USBMountObserver); | 66 DISALLOW_COPY_AND_ASSIGN(USBMountObserver); |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 } // namespace chromeos | 69 } // namespace chromeos |
| 70 #endif // CHROME_BROWSER_CHROMEOS_USB_MOUNT_OBSERVER_H_ | 70 #endif // CHROME_BROWSER_CHROMEOS_USB_MOUNT_OBSERVER_H_ |
| OLD | NEW |