summaryrefslogtreecommitdiffstats
path: root/chrome/browser/history/top_sites_database.h
diff options
context:
space:
mode:
authornshkrob@chromium.org <nshkrob@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-24 23:24:17 +0000
committernshkrob@chromium.org <nshkrob@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-24 23:24:17 +0000
commit5601f989e08815929e184d04fb720956d07e76cd (patch)
treebe05175a4791fe7be4297487c1f4a5f6180f27e9 /chrome/browser/history/top_sites_database.h
parenteacf8143f91d374403508bb95fea1a0761dc9027 (diff)
downloadchromium_src-5601f989e08815929e184d04fb720956d07e76cd.zip
chromium_src-5601f989e08815929e184d04fb720956d07e76cd.tar.gz
chromium_src-5601f989e08815929e184d04fb720956d07e76cd.tar.bz2
Adding a mock database layer.
Testing support of storage in TopSites. BUG=None TEST=TopSitesTest Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=48061 Review URL: http://codereview.chromium.org/2133011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48099 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history/top_sites_database.h')
-rw-r--r--chrome/browser/history/top_sites_database.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/chrome/browser/history/top_sites_database.h b/chrome/browser/history/top_sites_database.h
new file mode 100644
index 0000000..50da75d
--- /dev/null
+++ b/chrome/browser/history/top_sites_database.h
@@ -0,0 +1,55 @@
+// Copyright (c) 2010 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_HISTORY_TOP_SITES_DATABASE_H_
+#define CHROME_BROWSER_HISTORY_TOP_SITES_DATABASE_H_
+
+#include <vector>
+
+#include "app/sql/connection.h"
+#include "app/sql/init_status.h"
+#include "app/sql/meta_table.h"
+#include "base/ref_counted.h"
+#include "chrome/browser/history/history_types.h"
+#include "chrome/browser/history/url_database.h" // For DBCloseScoper.
+
+class FilePath;
+class RefCountedMemory;
+class SkBitmap;
+
+namespace base {
+class Time;
+}
+
+namespace history {
+
+// Interface to be implemented by the real storage layer as well as
+// the mockup database for testing.
+class TopSitesDatabase {
+ public:
+ virtual ~TopSitesDatabase() {}
+
+ // Returns a list of all URLs currently in the table.
+ virtual MostVisitedURLList GetTopURLs() = 0;
+
+ // Set a thumbnail for a URL. |url_rank| is the position of the URL
+ // in the list of TopURLs, zero-based.
+ // If the URL is not in the table, add it. If it is, replace its
+ // thumbnail.
+ virtual void SetPageThumbnail(const MostVisitedURL& url,
+ int url_rank,
+ const TopSites::Images thumbnail) = 0;
+
+ // Get a thumbnail for a given page. Returns true iff we have the thumbnail.
+ virtual bool GetPageThumbnail(const MostVisitedURL& url,
+ TopSites::Images* thumbnail) const = 0;
+
+ // Remove the record for this URL. Returns true iff removed successfully.
+ virtual bool RemoveURL(const MostVisitedURL& url) = 0;
+};
+
+} // namespace history
+
+#endif // CHROME_BROWSER_HISTORY_TOP_SITES_DATABASE_H_
+