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

Unified Diff: chrome/browser/history/chrome_history_client.h

Issue 285233012: Abstract history dependencies on bookmarks through HistoryClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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_client.h
diff --git a/chrome/browser/history/chrome_history_client.h b/chrome/browser/history/chrome_history_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..61a6b507b0058e3700cbae1309640f8ff48548c2
--- /dev/null
+++ b/chrome/browser/history/chrome_history_client.h
@@ -0,0 +1,41 @@
+// Copyright 2014 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_CLIENT_H_
+#define CHROME_BROWSER_HISTORY_CHROME_HISTORY_CLIENT_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/history/history_service.h"
Jiang Jiang 2014/05/19 21:51:50 Forward declare is enough.
sdefresne 2014/05/23 10:02:49 Done.
+#include "components/history/core/browser/history_client.h"
+#include "components/keyed_service/core/keyed_service.h"
+
+class Profile;
+class HistoryService;
+
+namespace history {
+
+class ChromeHistoryClient : public HistoryClient,
+ public KeyedService {
+ public:
+ ChromeHistoryClient(Profile* profile);
+
+ HistoryService* history_service() {
Jiang Jiang 2014/05/19 21:51:50 Should be a const?
sdefresne 2014/05/23 10:02:49 Done.
+ return history_service_.get();
+ }
+
+ // HistoryClient:
+ virtual bool IsBookmarked(const GURL& url) OVERRIDE;
+ virtual void GetBookmarks(std::vector<URLAndTitle>* bookmarks) OVERRIDE;
+
+ // KeyedService:
+ virtual void Shutdown() OVERRIDE;
+
+ private:
+ scoped_ptr<HistoryService> history_service_;
+ Profile* profile_;
+};
+
+} // namespace history
+
+#endif // CHROME_BROWSER_HISTORY_CHROME_HISTORY_CLIENT_H_

Powered by Google App Engine
This is Rietveld 408576698