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 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_FILE_SYSTEM_CONTEXT_H_ 6 #define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_FILE_SYSTEM_CONTEXT_H_ 7 8 // Manages isolated filesystem namespaces for media file systems. 9 10 #include <string> 11 12 #include "base/memory/ref_counted.h" 13 #include "chrome/browser/media_galleries/scoped_mtp_device_map_entry.h" 14 15 namespace base { 16 class FilePath; 17 } 18 19 namespace chrome { 20 21 class MediaFileSystemRegistry; 22 23 class MediaFileSystemContext { 24 public: 25 virtual ~MediaFileSystemContext() {} 26 27 // Register a media file system (filtered to media files) for |path| and 28 // return the new file system id. 29 virtual std::string RegisterFileSystemForMassStorage( 30 const std::string& device_id, const base::FilePath& path) = 0; 31 32 // Registers and returns the file system id for the MTP or PTP device 33 // specified by |device_id| and |path|. Updates |entry| with the corresponding 34 // ScopedMTPDeviceMapEntry object. 35 virtual std::string RegisterFileSystemForMTPDevice( 36 const std::string& device_id, const base::FilePath& path, 37 scoped_refptr<ScopedMTPDeviceMapEntry>* entry) = 0; 38 39 // Revoke the passed |fsid|. 40 virtual void RevokeFileSystem(const std::string& fsid) = 0; 41 }; 42 43 } // namespace 44 45 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_FILE_SYSTEM_CONTEXT_H_ 46