1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_CLIENT_H_
6 #define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_CLIENT_H_
10 #include "base/macros.h"
11 #include "base/strings/string16.h"
12 #include "components/keyed_service/core/keyed_service.h"
13 #include "sql/init_status.h"
23 // This class abstracts operations that depend on the embedder's environment,
25 class HistoryClient : public KeyedService {
29 // Waits until the bookmarks have been loaded.
31 // Must not be called from the main thread.
32 virtual void BlockUntilBookmarksLoaded();
34 // Returns true if the specified URL is bookmarked.
36 // If not on the main thread, then BlockUntilBookmarksLoaded must be called.
37 virtual bool IsBookmarked(const GURL& url);
39 // Returns, by reference in |bookmarks|, the set of bookmarked urls and their
40 // titles. This returns the unique set of URLs. For example, if two bookmarks
41 // reference the same URL only one entry is added even if the title are not
44 // If not on the main thread, then BlockUntilBookmarksLoaded must be called.
45 virtual void GetBookmarks(std::vector<URLAndTitle>* bookmarks);
47 // Notifies the embedder that there was a problem reading the database.
49 // Must be called from the main thread.
50 virtual void NotifyProfileError(sql::InitStatus init_status);
52 // Returns whether database errors should be reported to the crash server.
53 virtual bool ShouldReportDatabaseError();
56 DISALLOW_COPY_AND_ASSIGN(HistoryClient);
59 } // namespace history
61 #endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_CLIENT_H_