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

Unified Diff: components/history/core/browser/history_backend_client.h

Issue 1198373002: Split HistoryClient in two objects (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@1192403002
Patch Set: Add comments in ChromeHistoryBackendClient Created 5 years, 6 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
Index: components/history/core/browser/history_backend_client.h
diff --git a/components/history/core/browser/history_backend_client.h b/components/history/core/browser/history_backend_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..4ebc4966ecad247a8bd2d7244c84feed32804108
--- /dev/null
+++ b/components/history/core/browser/history_backend_client.h
@@ -0,0 +1,65 @@
+// Copyright 2015 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 COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_CLIENT_H_
+#define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_CLIENT_H_
+
+#include <vector>
+
+#include "base/macros.h"
+#include "base/strings/string16.h"
+#include "url/gurl.h"
+
+namespace base {
+class FilePath;
+}
+
+namespace history {
+
+class HistoryBackend;
+class HistoryDatabase;
+class ThumbnailDatabase;
+
+struct URLAndTitle {
+ GURL url;
+ base::string16 title;
+};
+
+class HistoryBackendClient {
+ public:
+ HistoryBackendClient() {}
+ virtual ~HistoryBackendClient() {}
+
+ // Returns true if the specified URL is bookmarked.
+ virtual bool IsBookmarked(const GURL& url) = 0;
+
+ // Returns, by reference in |bookmarks|, the set of bookmarked URLs and their
+ // title. This returns the unique set of URLs. For example, if two bookmarks
+ // reference the same URL only one entry is added even if the title are not
+ // the same.
+ virtual void GetBookmarks(std::vector<URLAndTitle>* bookmarks) = 0;
+
+ // Returns whether database errors should be reported to the crash server.
+ virtual bool ShouldReportDatabaseError() = 0;
+
+#if defined(OS_ANDROID)
+ // Called upon initialization of the HistoryBackend.
+ virtual void OnHistoryBackendInitialized(
+ HistoryBackend* history_backend,
+ HistoryDatabase* history_database,
+ ThumbnailDatabase* thumbnail_database,
+ const base::FilePath& history_dir) = 0;
+
+ // Called upon destruction of the HistoryBackend.
+ virtual void OnHistoryBackendDestroyed(HistoryBackend* history_backend,
+ const base::FilePath& history_dir) = 0;
+#endif // defined(OS_ANDROID)
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(HistoryBackendClient);
+};
+
+} // namespace history
+
+#endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_BACKEND_CLIENT_H_
« no previous file with comments | « components/history/core/browser/history_backend.cc ('k') | components/history/core/browser/history_backend_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698