| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_MEDIA_GALLERIES_IMPORTED_MEDIA_GALLERY_REGISTRY_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_IMPORTED_MEDIA_GALLERY_REGISTRY_H_ |
| 6 #define CHROME_BROWSER_MEDIA_GALLERIES_IMPORTED_MEDIA_GALLERY_REGISTRY_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERIES_IMPORTED_MEDIA_GALLERY_REGISTRY_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 // This class lives on the MediaTaskRunner thread. It has some static | 31 // This class lives on the MediaTaskRunner thread. It has some static |
| 32 // methods which are called on the UI thread. | 32 // methods which are called on the UI thread. |
| 33 // | 33 // |
| 34 // MediaTaskRunner is not guaranteed to be one thread, but it is guaranteed | 34 // MediaTaskRunner is not guaranteed to be one thread, but it is guaranteed |
| 35 // to be a series of sequential calls. See SequencedTaskRunner for details. | 35 // to be a series of sequential calls. See SequencedTaskRunner for details. |
| 36 class ImportedMediaGalleryRegistry { | 36 class ImportedMediaGalleryRegistry { |
| 37 public: | 37 public: |
| 38 static ImportedMediaGalleryRegistry* GetInstance(); | 38 static ImportedMediaGalleryRegistry* GetInstance(); |
| 39 | 39 |
| 40 // Should be called on the UI thread only. | 40 // Should be called on the UI thread only. |
| 41 std::string RegisterPicasaFilesystemOnUIThread( | 41 bool RegisterPicasaFilesystemOnUIThread(const std::string& fs_name, |
| 42 const base::FilePath& database_path); | 42 const base::FilePath& database_path); |
| 43 | 43 |
| 44 std::string RegisterITunesFilesystemOnUIThread( | 44 bool RegisterITunesFilesystemOnUIThread( |
| 45 const std::string& fs_name, |
| 45 const base::FilePath& xml_library_path); | 46 const base::FilePath& xml_library_path); |
| 46 | 47 |
| 47 std::string RegisterIPhotoFilesystemOnUIThread( | 48 bool RegisterIPhotoFilesystemOnUIThread( |
| 49 const std::string& fs_name, |
| 48 const base::FilePath& xml_library_path); | 50 const base::FilePath& xml_library_path); |
| 49 | 51 |
| 50 bool RevokeImportedFilesystemOnUIThread(const std::string& fsid); | 52 bool RevokeImportedFilesystemOnUIThread(const std::string& fs_name); |
| 53 |
| 54 // Path where all virtual file systems are "mounted." |
| 55 base::FilePath ImportedRoot(); |
| 51 | 56 |
| 52 // Should be called on the MediaTaskRunner thread only. | 57 // Should be called on the MediaTaskRunner thread only. |
| 53 #if defined(OS_WIN) || defined(OS_MACOSX) | 58 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 54 static picasa::PicasaDataProvider* PicasaDataProvider(); | 59 static picasa::PicasaDataProvider* PicasaDataProvider(); |
| 55 static itunes::ITunesDataProvider* ITunesDataProvider(); | 60 static itunes::ITunesDataProvider* ITunesDataProvider(); |
| 56 #endif // defined(OS_WIN) || defined(OS_MACOSX) | 61 #endif // defined(OS_WIN) || defined(OS_MACOSX) |
| 57 | 62 |
| 58 #if defined(OS_MACOSX) | 63 #if defined(OS_MACOSX) |
| 59 static iphoto::IPhotoDataProvider* IPhotoDataProvider(); | 64 static iphoto::IPhotoDataProvider* IPhotoDataProvider(); |
| 60 #endif // defined(OS_MACOSX) | 65 #endif // defined(OS_MACOSX) |
| (...skipping 13 matching lines...) Expand all Loading... |
| 74 | 79 |
| 75 void RegisterITunesFileSystem(const base::FilePath& xml_library_path); | 80 void RegisterITunesFileSystem(const base::FilePath& xml_library_path); |
| 76 void RevokeITunesFileSystem(); | 81 void RevokeITunesFileSystem(); |
| 77 #endif // defined(OS_WIN) || defined(OS_MACOSX) | 82 #endif // defined(OS_WIN) || defined(OS_MACOSX) |
| 78 | 83 |
| 79 #if defined(OS_MACOSX) | 84 #if defined(OS_MACOSX) |
| 80 void RegisterIPhotoFileSystem(const base::FilePath& xml_library_path); | 85 void RegisterIPhotoFileSystem(const base::FilePath& xml_library_path); |
| 81 void RevokeIPhotoFileSystem(); | 86 void RevokeIPhotoFileSystem(); |
| 82 #endif // defined(OS_MACOSX) | 87 #endif // defined(OS_MACOSX) |
| 83 | 88 |
| 89 base::FilePath imported_root_; |
| 90 |
| 84 #if defined(OS_WIN) || defined(OS_MACOSX) | 91 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 85 // The data providers are only set or accessed on the task runner thread. | 92 // The data providers are only set or accessed on the task runner thread. |
| 86 scoped_ptr<picasa::PicasaDataProvider> picasa_data_provider_; | 93 scoped_ptr<picasa::PicasaDataProvider> picasa_data_provider_; |
| 87 scoped_ptr<itunes::ITunesDataProvider> itunes_data_provider_; | 94 scoped_ptr<itunes::ITunesDataProvider> itunes_data_provider_; |
| 88 | 95 |
| 89 // The remaining members are only accessed on the IO thread. | 96 // The remaining members are only accessed on the IO thread. |
| 90 std::set<std::string> picasa_fsids_; | 97 std::set<std::string> picasa_fs_names_; |
| 91 std::set<std::string> itunes_fsids_; | 98 std::set<std::string> itunes_fs_names_; |
| 92 | 99 |
| 93 #ifndef NDEBUG | 100 #ifndef NDEBUG |
| 94 base::FilePath picasa_database_path_; | 101 base::FilePath picasa_database_path_; |
| 95 base::FilePath itunes_xml_library_path_; | 102 base::FilePath itunes_xml_library_path_; |
| 96 #endif | 103 #endif |
| 97 #endif // defined(OS_WIN) || defined(OS_MACOSX) | 104 #endif // defined(OS_WIN) || defined(OS_MACOSX) |
| 98 | 105 |
| 99 #if defined(OS_MACOSX) | 106 #if defined(OS_MACOSX) |
| 100 scoped_ptr<iphoto::IPhotoDataProvider> iphoto_data_provider_; | 107 scoped_ptr<iphoto::IPhotoDataProvider> iphoto_data_provider_; |
| 101 | 108 |
| 102 std::set<std::string> iphoto_fsids_; | 109 std::set<std::string> iphoto_fs_names_; |
| 103 | 110 |
| 104 #ifndef NDEBUG | 111 #ifndef NDEBUG |
| 105 base::FilePath iphoto_xml_library_path_; | 112 base::FilePath iphoto_xml_library_path_; |
| 106 #endif | 113 #endif |
| 107 #endif // defined(OS_MACOSX) | 114 #endif // defined(OS_MACOSX) |
| 108 | 115 |
| 109 DISALLOW_COPY_AND_ASSIGN(ImportedMediaGalleryRegistry); | 116 DISALLOW_COPY_AND_ASSIGN(ImportedMediaGalleryRegistry); |
| 110 }; | 117 }; |
| 111 | 118 |
| 112 #endif // CHROME_BROWSER_MEDIA_GALLERIES_IMPORTED_MEDIA_GALLERY_REGISTRY_H_ | 119 #endif // CHROME_BROWSER_MEDIA_GALLERIES_IMPORTED_MEDIA_GALLERY_REGISTRY_H_ |
| OLD | NEW |