blob: 2d41937b76afe878c3a345ff7e83a67353e0fb45 [file] [log] [blame]
// 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/macros.h"
#include "components/history/core/browser/history_client.h"
class HistoryService;
class Profile;
namespace bookmarks {
class BookmarkModel;
}
// This class implements history::HistoryClient to abstract operations that
// depend on Chrome environment.
class ChromeHistoryClient : public history::HistoryClient {
public:
explicit ChromeHistoryClient(bookmarks::BookmarkModel* bookmark_model);
~ChromeHistoryClient() override;
// history::HistoryClient:
void BlockUntilBookmarksLoaded() override;
bool IsBookmarked(const GURL& url) override;
void GetBookmarks(std::vector<history::URLAndTitle>* bookmarks) override;
void NotifyProfileError(sql::InitStatus init_status) override;
bool ShouldReportDatabaseError() override;
// KeyedService:
void Shutdown() override;
private:
// The BookmarkModel, this should outlive ChromeHistoryClient.
bookmarks::BookmarkModel* bookmark_model_;
DISALLOW_COPY_AND_ASSIGN(ChromeHistoryClient);
};
#endif // CHROME_BROWSER_HISTORY_CHROME_HISTORY_CLIENT_H_