summaryrefslogtreecommitdiffstats
path: root/chrome/browser/thumbnail_store.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-27 21:51:06 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-27 21:51:06 +0000
commit26feb1fe0c81e3545aa2bc85bc6ec7cc366049cd (patch)
treea029ed6c63568b4ce142210810991569686ac616 /chrome/browser/thumbnail_store.h
parent861c310c23653fddecb35bde6ea58e47cafaa1a6 (diff)
downloadchromium_src-26feb1fe0c81e3545aa2bc85bc6ec7cc366049cd.zip
chromium_src-26feb1fe0c81e3545aa2bc85bc6ec7cc366049cd.tar.gz
chromium_src-26feb1fe0c81e3545aa2bc85bc6ec7cc366049cd.tar.bz2
Add an unused interface for storing thumbnails. This is to replace the history
system's thumbnail storage. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17028 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/thumbnail_store.h')
-rw-r--r--chrome/browser/thumbnail_store.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/chrome/browser/thumbnail_store.h b/chrome/browser/thumbnail_store.h
new file mode 100644
index 0000000..af41c97
--- /dev/null
+++ b/chrome/browser/thumbnail_store.h
@@ -0,0 +1,52 @@
+// Copyright (c) 2009 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_THUMBNAIL_STORE_H_
+#define CHROME_BROWSER_THUMBNAIL_STORE_H_
+
+#include <vector>
+
+#include "base/file_path.h"
+
+class GURL;
+class SkBitmap;
+struct ThumbnailScore;
+namespace base {
+class Time;
+}
+
+// This storage interface provides storage for the thumbnails used
+// by the new_tab_ui.
+class ThumbnailStore {
+ public:
+ ThumbnailStore();
+ ~ThumbnailStore();
+
+ // Must be called after creation but before other methods are called.
+ // file_path is where a new database should be created or the
+ // location of an existing databse.
+ // If false is returned, no other methods should be called.
+ bool Init(const FilePath& file_path);
+
+ // Stores the given thumbnail and score with the associated url.
+ bool SetPageThumbnail(const GURL& url,
+ const SkBitmap& thumbnail,
+ const ThumbnailScore& score,
+ const base::Time& time);
+
+ // Retrieves the thumbnail and score for the given url.
+ // Returns false if there is not data for the given url or some other
+ // error occurred.
+ bool GetPageThumbnail(const GURL& url,
+ SkBitmap* thumbnail,
+ ThumbnailScore* score);
+
+ private:
+ // The location of the thumbnail store.
+ FilePath file_path_;
+
+ DISALLOW_COPY_AND_ASSIGN(ThumbnailStore);
+};
+
+#endif // CHROME_BROWSER_THUMBNAIL_STORE_H_