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_FILEAPI_PICASA_PICASA_DATA_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PICASA_DATA_PROVIDER_H_ |
6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PICASA_DATA_PROVIDER_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PICASA_DATA_PROVIDER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
18 #include "chrome/common/media_galleries/picasa_types.h" | 18 #include "chrome/common/media_galleries/picasa_types.h" |
19 | 19 |
20 namespace picasa { | 20 namespace picasa { |
21 | 21 |
22 struct AlbumInfo; | |
23 class SafePicasaAlbumTableReader; | 22 class SafePicasaAlbumTableReader; |
24 | 23 |
25 typedef std::map<std::string, AlbumInfo> AlbumMap; | |
26 | |
27 // Created and owned by ImportedMediaGalleryRegistryTaskRunnerValues | 24 // Created and owned by ImportedMediaGalleryRegistryTaskRunnerValues |
28 class PicasaDataProvider { | 25 class PicasaDataProvider { |
29 public: | 26 public: |
30 explicit PicasaDataProvider(const base::FilePath& database_path); | 27 explicit PicasaDataProvider(const base::FilePath& database_path); |
31 virtual ~PicasaDataProvider(); | 28 virtual ~PicasaDataProvider(); |
32 | 29 |
33 // Ask the data provider to refresh the data if necessary. |ready_callback| | 30 // Ask the data provider to refresh the data if necessary. |ready_callback| |
34 // will be called when the data is up to date | 31 // will be called when the data is up to date |
35 // TODO(tommycli): Investigate having the callback return a bool indicating | 32 // TODO(tommycli): Investigate having the callback return a bool indicating |
36 // success or failure - and handling it intelligently in PicasaFileUtil. | 33 // success or failure - and handling it intelligently in PicasaFileUtil. |
(...skipping 26 matching lines...) Expand all Loading... |
63 scoped_refptr<SafePicasaAlbumTableReader> album_table_reader_; | 60 scoped_refptr<SafePicasaAlbumTableReader> album_table_reader_; |
64 | 61 |
65 base::WeakPtrFactory<PicasaDataProvider> weak_factory_; | 62 base::WeakPtrFactory<PicasaDataProvider> weak_factory_; |
66 | 63 |
67 DISALLOW_COPY_AND_ASSIGN(PicasaDataProvider); | 64 DISALLOW_COPY_AND_ASSIGN(PicasaDataProvider); |
68 }; | 65 }; |
69 | 66 |
70 } // namespace picasa | 67 } // namespace picasa |
71 | 68 |
72 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PICASA_DATA_PROVIDER_H_ | 69 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PICASA_DATA_PROVIDER_H_ |
OLD | NEW |