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 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 static USBMountObserver* Get() { | 36 static USBMountObserver* Get() { |
37 return Singleton<USBMountObserver>::get(); | 37 return Singleton<USBMountObserver>::get(); |
38 } | 38 } |
39 void Observe(NotificationType type, | 39 void Observe(NotificationType type, |
40 const NotificationSource& source, | 40 const NotificationSource& source, |
41 const NotificationDetails& details); | 41 const NotificationDetails& details); |
42 | 42 |
43 void MountChanged(chromeos::MountLibrary* obj, | 43 void MountChanged(chromeos::MountLibrary* obj, |
44 chromeos::MountEventType evt, | 44 chromeos::MountEventType evt, |
45 const std::string& path); | 45 const std::string& path); |
| 46 |
| 47 void ScanForDevices(chromeos::MountLibrary* obj); |
| 48 |
46 private: | 49 private: |
47 typedef std::vector<BrowserWithPath>::iterator BrowserIterator; | 50 typedef std::vector<BrowserWithPath>::iterator BrowserIterator; |
48 BrowserIterator FindBrowserForPath(const std::string& path); | 51 BrowserIterator FindBrowserForPath(const std::string& path); |
49 | 52 |
50 void RemoveBrowserFromVector(const std::string& path); | 53 void RemoveBrowserFromVector(const std::string& path); |
51 | 54 |
52 // Used to create a window of a standard size, and add it to a list | 55 // Used to create a window of a standard size, and add it to a list |
53 // of tracked browser windows in case that device goes away. | 56 // of tracked browser windows in case that device goes away. |
54 void OpenFileBrowse(const std::string& url, | 57 void OpenFileBrowse(const std::string& url, |
55 const std::string& device_path, | 58 const std::string& device_path, |
56 bool small); | 59 bool small); |
57 | 60 |
58 std::vector<BrowserWithPath> browsers_; | 61 std::vector<BrowserWithPath> browsers_; |
59 NotificationRegistrar registrar_; | 62 NotificationRegistrar registrar_; |
60 | 63 |
61 DISALLOW_COPY_AND_ASSIGN(USBMountObserver); | 64 DISALLOW_COPY_AND_ASSIGN(USBMountObserver); |
62 }; | 65 }; |
63 | 66 |
64 } // namespace chromeos | 67 } // namespace chromeos |
65 #endif // CHROME_BROWSER_CHROMEOS_USB_MOUNT_OBSERVER_H_ | 68 #endif // CHROME_BROWSER_CHROMEOS_USB_MOUNT_OBSERVER_H_ |
OLD | NEW |