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_FILEAPI_MEDIA_PATH_FILTER_H_ 6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_PATH_FILTER_H_ 7 8 #include <vector> 9 10 #include "base/files/file_path.h" 11 #include "base/synchronization/lock.h" 12 13 namespace base { 14 class FilePath; 15 } 16 17 namespace chrome { 18 19 // This class holds the list of file path extensions that we should expose on 20 // media filesystem. 21 class MediaPathFilter { 22 public: 23 MediaPathFilter(); 24 ~MediaPathFilter(); 25 bool Match(const base::FilePath& path); 26 27 private: 28 typedef std::vector<base::FilePath::StringType> MediaFileExtensionList; 29 30 void EnsureInitialized(); 31 32 bool initialized_; 33 base::Lock initialization_lock_; 34 MediaFileExtensionList media_file_extensions_; 35 36 DISALLOW_COPY_AND_ASSIGN(MediaPathFilter); 37 }; 38 39 } // namespace chrome 40 41 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MEDIA_PATH_FILTER_H_ 42