OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PICASA_FILE_UTIL_H_ | |
6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PICASA_FILE_UTIL_H_ | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "base/memory/weak_ptr.h" | |
10 #include "chrome/browser/media_galleries/fileapi/native_media_file_util.h" | |
11 | |
12 namespace picasa { | |
13 | |
14 class PicasaDataProvider; | |
15 | |
16 extern const char kPicasaDirAlbums[]; | |
17 extern const char kPicasaDirFolders[]; | |
18 | |
19 // PicasaFileUtil virtual directory structure example: | |
20 // - /albums/ | |
21 // - /albums/albumname 2013-08-21/ | |
22 // - /albums/albumname 2013-08-21/imagename.jpg | |
23 // - /albums/duplicatename 2013-08-21/ | |
24 // - /albums/duplicatename 2013-08-21 (1)/ | |
25 // - /folders/ | |
26 // - /folders/My Pictures 2013-08-21/flower.jpg | |
27 // - /folders/Photos 2013-08-21/ | |
28 class PicasaFileUtil : public chrome::NativeMediaFileUtil { | |
29 public: | |
30 explicit PicasaFileUtil(chrome::MediaPathFilter* media_path_filter); | |
31 virtual ~PicasaFileUtil(); | |
32 | |
33 protected: | |
34 // NativeMediaFileUtil overrides. | |
35 virtual void GetFileInfoOnTaskRunnerThread( | |
36 scoped_ptr<fileapi::FileSystemOperationContext> context, | |
37 const fileapi::FileSystemURL& url, | |
38 const GetFileInfoCallback& callback) OVERRIDE; | |
39 virtual void ReadDirectoryOnTaskRunnerThread( | |
40 scoped_ptr<fileapi::FileSystemOperationContext> context, | |
41 const fileapi::FileSystemURL& url, | |
42 const ReadDirectoryCallback& callback) OVERRIDE; | |
43 virtual base::PlatformFileError GetFileInfoSync( | |
44 fileapi::FileSystemOperationContext* context, | |
45 const fileapi::FileSystemURL& url, | |
46 base::PlatformFileInfo* file_info, | |
47 base::FilePath* platform_path) OVERRIDE; | |
48 virtual base::PlatformFileError ReadDirectorySync( | |
49 fileapi::FileSystemOperationContext* context, | |
50 const fileapi::FileSystemURL& url, | |
51 EntryList* file_list) OVERRIDE; | |
52 virtual base::PlatformFileError GetLocalFilePath( | |
53 fileapi::FileSystemOperationContext* context, | |
54 const fileapi::FileSystemURL& url, | |
55 base::FilePath* local_file_path) OVERRIDE; | |
56 | |
57 private: | |
58 void GetFileInfoWithFreshDataProvider( | |
59 scoped_ptr<fileapi::FileSystemOperationContext> context, | |
60 const fileapi::FileSystemURL& url, | |
61 const GetFileInfoCallback& callback, | |
62 bool success); | |
63 void ReadDirectoryWithFreshDataProvider( | |
64 scoped_ptr<fileapi::FileSystemOperationContext> context, | |
65 const fileapi::FileSystemURL& url, | |
66 const ReadDirectoryCallback& callback, | |
67 bool success); | |
68 | |
69 virtual PicasaDataProvider* GetDataProvider(); | |
70 | |
71 base::WeakPtrFactory<PicasaFileUtil> weak_factory_; | |
72 | |
73 DISALLOW_COPY_AND_ASSIGN(PicasaFileUtil); | |
74 }; | |
75 | |
76 } // namespace picasa | |
77 | |
78 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PICASA_FILE_UTIL_H_ | |
OLD | NEW |