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 // MediaFileSystemRegistry registers pictures directories and media devices as | 5 // MediaFileSystemRegistry registers pictures directories and media devices as |
6 // File API filesystems and keeps track of the path to filesystem ID mappings. | 6 // File API filesystems and keeps track of the path to filesystem ID mappings. |
7 | 7 |
8 #ifndef CHROME_BROWSER_MEDIA_GALLERY_MEDIA_FILE_SYSTEM_REGISTRY_H_ | 8 #ifndef CHROME_BROWSER_MEDIA_GALLERY_MEDIA_FILE_SYSTEM_REGISTRY_H_ |
9 #define CHROME_BROWSER_MEDIA_GALLERY_MEDIA_FILE_SYSTEM_REGISTRY_H_ | 9 #define CHROME_BROWSER_MEDIA_GALLERY_MEDIA_FILE_SYSTEM_REGISTRY_H_ |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 const extensions::Extension& extension); | 55 const extensions::Extension& extension); |
56 | 56 |
57 // base::SystemMonitor::DevicesChangedObserver implementation. | 57 // base::SystemMonitor::DevicesChangedObserver implementation. |
58 virtual void OnMediaDeviceDetached(const std::string& id) OVERRIDE; | 58 virtual void OnMediaDeviceDetached(const std::string& id) OVERRIDE; |
59 | 59 |
60 // content::NotificationObserver implementation. | 60 // content::NotificationObserver implementation. |
61 virtual void Observe(int type, | 61 virtual void Observe(int type, |
62 const content::NotificationSource& source, | 62 const content::NotificationSource& source, |
63 const content::NotificationDetails& details) OVERRIDE; | 63 const content::NotificationDetails& details) OVERRIDE; |
64 | 64 |
| 65 std::string GetDeviceIdFromPath(const FilePath& path) const; |
| 66 |
65 private: | 67 private: |
66 friend struct base::DefaultLazyInstanceTraits<MediaFileSystemRegistry>; | 68 friend struct base::DefaultLazyInstanceTraits<MediaFileSystemRegistry>; |
67 | 69 |
68 // Mapping of media directories to filesystem IDs. | 70 // Mapping of media directories to filesystem IDs. |
69 typedef std::map<FilePath, std::string> MediaPathToFSIDMap; | 71 typedef std::map<FilePath, std::string> MediaPathToFSIDMap; |
70 | 72 |
71 // Mapping of RPH to MediaPathToFSIDMaps. | 73 // Mapping of RPH to MediaPathToFSIDMaps. |
72 typedef std::map<const content::RenderProcessHost*, | 74 typedef std::map<const content::RenderProcessHost*, |
73 MediaPathToFSIDMap> ChildIdToMediaFSMap; | 75 MediaPathToFSIDMap> ChildIdToMediaFSMap; |
74 | 76 |
(...skipping 29 matching lines...) Expand all Loading... |
104 | 106 |
105 // Is only used on the UI thread. | 107 // Is only used on the UI thread. |
106 content::NotificationRegistrar registrar_; | 108 content::NotificationRegistrar registrar_; |
107 | 109 |
108 DISALLOW_COPY_AND_ASSIGN(MediaFileSystemRegistry); | 110 DISALLOW_COPY_AND_ASSIGN(MediaFileSystemRegistry); |
109 }; | 111 }; |
110 | 112 |
111 } // namespace chrome | 113 } // namespace chrome |
112 | 114 |
113 #endif // CHROME_BROWSER_MEDIA_GALLERY_MEDIA_FILE_SYSTEM_REGISTRY_H_ | 115 #endif // CHROME_BROWSER_MEDIA_GALLERY_MEDIA_FILE_SYSTEM_REGISTRY_H_ |
OLD | NEW |