Chromium Code Reviews
|
| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // MediaDeviceManager registers pictures directories as File API filesystems | |
| 6 // and keeps track of the path to filesystem ID mappings. | |
| 7 // In the near future, MediaDeviceManager will also support media devices. | |
| 8 | |
| 9 #ifndef CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_MANAGER_H_ | |
| 10 #define CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_MANAGER_H_ | |
| 11 #pragma once | |
| 12 | |
| 13 #include <map> | |
| 14 #include <string> | |
| 15 #include <utility> | |
| 16 #include <vector> | |
| 17 | |
| 18 #include "base/basictypes.h" | |
| 19 #include "base/lazy_instance.h" | |
| 20 | |
| 21 class FilePath; | |
| 22 | |
| 23 namespace fileapi { | |
| 24 class IsolatedContext; | |
| 25 } | |
| 26 | |
| 27 namespace chrome { | |
| 28 | |
| 29 class MediaDeviceManager { | |
|
vandebo (ex-Chrome)
2012/05/23 00:50:46
nit: MediaFileSystemsManager / MediaFileSystemRegi
Lei Zhang
2012/05/23 03:12:49
Sure, MediaFileSystemRegistry it is.
| |
| 30 public: | |
| 31 // (Filesystem ID, path) | |
| 32 typedef std::pair<std::string, FilePath> MediaFSIDAndPath; | |
| 33 | |
| 34 // The instance is lazily created per browser process. | |
| 35 static MediaDeviceManager* GetInstance(); | |
| 36 | |
| 37 // Returns the list of media filesystem IDs and paths. | |
| 38 // Called on the UI thread. | |
| 39 std::vector<MediaFSIDAndPath>* GetMediaFileSystems(); | |
|
vandebo (ex-Chrome)
2012/05/23 00:50:46
I think (you may want to check with others), that
Lei Zhang
2012/05/23 03:12:49
Done. I see a few other places that do this and ci
| |
| 40 | |
| 41 private: | |
| 42 friend struct base::DefaultLazyInstanceTraits<MediaDeviceManager>; | |
| 43 | |
| 44 // Mapping of media directories to filesystem IDs. | |
| 45 typedef std::map<FilePath, std::string> MediaPathToFSIDMap; | |
| 46 | |
| 47 // Obtain an instance of this class via GetInstance(). | |
| 48 MediaDeviceManager(); | |
| 49 virtual ~MediaDeviceManager(); | |
| 50 | |
| 51 // Registers a path as a media file system. | |
| 52 void RegisterPathAsFileSystem(const FilePath& path); | |
| 53 | |
| 54 MediaPathToFSIDMap media_fs_map_; | |
| 55 | |
| 56 DISALLOW_COPY_AND_ASSIGN(MediaDeviceManager); | |
| 57 }; | |
| 58 | |
| 59 } // namespace chrome | |
| 60 | |
| 61 #endif // CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_MANAGER_H_ | |
| OLD | NEW |