Index: components/history/core/browser/history_client.h |
diff --git a/components/history/core/browser/history_client.h b/components/history/core/browser/history_client.h |
index cc2da5845823c416361f47b1dabe772afc642c84..370d723392b5b90e232d37ec15fd97eed74956b1 100644 |
--- a/components/history/core/browser/history_client.h |
+++ b/components/history/core/browser/history_client.h |
@@ -5,17 +5,45 @@ |
#ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_CLIENT_H_ |
#define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_CLIENT_H_ |
+#include <vector> |
+ |
#include "base/macros.h" |
+#include "base/strings/string16.h" |
#include "components/keyed_service/core/keyed_service.h" |
+#include "url/gurl.h" |
namespace history { |
+struct URLAndTitle { |
+ GURL url; |
+ base::string16 title; |
+}; |
+ |
// This class abstracts operations that depend on the embedder's environment, |
// e.g. Chrome. |
class HistoryClient : public KeyedService { |
- protected: |
- HistoryClient() {} |
+ public: |
+ HistoryClient(); |
+ // Waits until the bookmarks have been loaded. |
+ // |
+ // Must not be called from the main thread. |
+ virtual void BlockUntilBookmarksLoaded(); |
+ |
+ // Returns true if the specified URL is bookmarked. |
+ // |
+ // If not on the main thread, then BlockUntilBookmarksLoaded must be called. |
+ virtual bool IsBookmarked(const GURL& url); |
+ |
+ // Returns, by reference in |bookmarks|, the set of bookmarked urls and their |
+ // titles. 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. |
+ // |
+ // If not on the main thread, then BlockUntilBookmarksLoaded must be called. |
+ virtual void GetBookmarks(std::vector<URLAndTitle>* bookmarks); |
+ |
+ protected: |
DISALLOW_COPY_AND_ASSIGN(HistoryClient); |
}; |