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

Unified Diff: chrome/browser/history/chrome_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: chrome/browser/history/chrome_history_backend_client.h
diff --git a/chrome/browser/history/chrome_history_backend_client.h b/chrome/browser/history/chrome_history_backend_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..96cc39c2e69271c593f39930e91b474786e74eec
--- /dev/null
+++ b/chrome/browser/history/chrome_history_backend_client.h
@@ -0,0 +1,44 @@
+// 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 CHROME_BROWSER_HISTORY_CHROME_HISTORY_BACKEND_CLIENT_H_
+#define CHROME_BROWSER_HISTORY_CHROME_HISTORY_BACKEND_CLIENT_H_
+
+#include "base/macros.h"
+#include "components/history/core/browser/history_backend_client.h"
+
+namespace bookmarks {
+class BookmarkModel;
+}
+
+// ChromeHistoryBackendClient implements history::HistoryBackendClient interface
+// to provides access to embedder-specific features.
+class ChromeHistoryBackendClient : public history::HistoryBackendClient {
+ public:
+ explicit ChromeHistoryBackendClient(bookmarks::BookmarkModel* bookmark_model);
+ ~ChromeHistoryBackendClient() override;
+
+ // history::HistoryBackendClient implementation.
+ bool IsBookmarked(const GURL& url) override;
+ void GetBookmarks(std::vector<history::URLAndTitle>* bookmarks) override;
+ bool ShouldReportDatabaseError() override;
+#if defined(OS_ANDROID)
+ void OnHistoryBackendInitialized(
+ history::HistoryBackend* history_backend,
+ history::HistoryDatabase* history_database,
+ history::ThumbnailDatabase* thumbnail_database,
+ const base::FilePath& history_dir) override;
+ void OnHistoryBackendDestroyed(history::HistoryBackend* history_backend,
+ const base::FilePath& history_dir) override;
+#endif // defined(OS_ANDROID)
+
+ private:
+ // BookmarkModel instance providing access to bookmarks. May be null during
+ // testing but must outlive ChromeHistoryBackendClient if non-null.
+ bookmarks::BookmarkModel* bookmark_model_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChromeHistoryBackendClient);
+};
+
+#endif // CHROME_BROWSER_HISTORY_CHROME_HISTORY_BACKEND_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698