Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1766)

Unified Diff: chrome/browser/media_galleries/fileapi/picasa/picasa_album_table_reader.h

Issue 13529028: PicasaAlbumTableReader for Media Galleries API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0005-picasa-import-pmp-reader
Patch Set: Update gypi file to exclude test on android. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/media_galleries/fileapi/picasa/picasa_album_table_reader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media_galleries/fileapi/picasa/picasa_album_table_reader.h
diff --git a/chrome/browser/media_galleries/fileapi/picasa/picasa_album_table_reader.h b/chrome/browser/media_galleries/fileapi/picasa/picasa_album_table_reader.h
new file mode 100644
index 0000000000000000000000000000000000000000..c32c4723ab9056c15730fdedbb4b6bcdd8671e4a
--- /dev/null
+++ b/chrome/browser/media_galleries/fileapi/picasa/picasa_album_table_reader.h
@@ -0,0 +1,81 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PICASA_ALBUM_TABLE_READER_H_
+#define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PICASA_ALBUM_TABLE_READER_H_
+
+#include "base/basictypes.h"
+#include "base/files/file_path.h"
+#include "base/time.h"
+
+namespace picasaimport {
+
+const base::Time::Exploded kPicasaVariantTimeEpoch = {
+ 1899, 12, 7, 30, // Dec 30, 1899 (Saturday)
+ 0, 0, 0, 0 // 00:00:00.000
+};
+
+const char kPicasaAlbumTableName[] = "albumdata";
+
+const uint32 kAlbumCategoryUserAlbum = 0;
+const uint32 kAlbumCategoryFolder = 2;
+const uint32 kAlbumCategoryInvalid = 0xffff; // Sentinel value.
+
+const char kAlbumTokenPrefix[] = "]album:";
+
+struct AlbumInfo {
+ AlbumInfo(const std::string& name, const base::Time& timestamp,
+ const std::string& uid);
+
+ ~AlbumInfo();
+
+ std::string name;
+ base::Time timestamp;
+ std::string uid;
+};
+
+struct FolderInfo {
+ FolderInfo(const std::string& name, const base::Time& timestamp,
+ const std::string& uid, const base::FilePath& path);
+
+ ~FolderInfo();
+
+ std::string name;
+ base::Time timestamp;
+ std::string uid;
+ base::FilePath path;
+};
+
+class PicasaAlbumTableReader {
+ public:
+ // |directory_path| is Picasa's db3 directory where the PMP table is stored.
+ explicit PicasaAlbumTableReader(const base::FilePath& directory_path);
+ virtual ~PicasaAlbumTableReader();
+
+ bool Init();
+
+ const std::vector<FolderInfo>& folders() const;
+
+ const std::vector<AlbumInfo>& user_albums() const;
+
+ static base::FilePath PicasaDB3Dir();
+
+ protected:
+ PicasaAlbumTableReader(const std::vector<FolderInfo>& folders,
+ const std::vector<AlbumInfo>& user_albums);
+
+ private:
+ const base::FilePath directory_path_;
+
+ bool initialized_;
+
+ std::vector<FolderInfo> folders_;
+ std::vector<AlbumInfo> user_albums_;
+
+ DISALLOW_COPY_AND_ASSIGN(PicasaAlbumTableReader);
+};
+
+} // namespace picasaimport
+
+#endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_PICASA_ALBUM_TABLE_READER_H_
« no previous file with comments | « no previous file | chrome/browser/media_galleries/fileapi/picasa/picasa_album_table_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698