| 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); |
| 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 23 matching lines...) Expand all Loading... |
| 98 | 100 |
| 99 // Is only used on the UI thread. | 101 // Is only used on the UI thread. |
| 100 content::NotificationRegistrar registrar_; | 102 content::NotificationRegistrar registrar_; |
| 101 | 103 |
| 102 DISALLOW_COPY_AND_ASSIGN(MediaFileSystemRegistry); | 104 DISALLOW_COPY_AND_ASSIGN(MediaFileSystemRegistry); |
| 103 }; | 105 }; |
| 104 | 106 |
| 105 } // namespace chrome | 107 } // namespace chrome |
| 106 | 108 |
| 107 #endif // CHROME_BROWSER_MEDIA_GALLERY_MEDIA_FILE_SYSTEM_REGISTRY_H_ | 109 #endif // CHROME_BROWSER_MEDIA_GALLERY_MEDIA_FILE_SYSTEM_REGISTRY_H_ |
| OLD | NEW |