OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_HISTORY_CHROME_HISTORY_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_HISTORY_CHROME_HISTORY_CLIENT_H_ |
6 #define CHROME_BROWSER_HISTORY_CHROME_HISTORY_CLIENT_H_ | 6 #define CHROME_BROWSER_HISTORY_CHROME_HISTORY_CLIENT_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "components/history/core/browser/history_client.h" | 9 #include "components/history/core/browser/history_client.h" |
10 | 10 |
| 11 class BookmarkModel; |
| 12 |
| 13 // This class implements history::HistoryClient to abstract operations that |
| 14 // depend on Chrome environment. |
11 class ChromeHistoryClient : public history::HistoryClient { | 15 class ChromeHistoryClient : public history::HistoryClient { |
12 public: | 16 public: |
13 ChromeHistoryClient(); | 17 explicit ChromeHistoryClient(BookmarkModel* bookmark_model); |
14 | 18 |
15 protected: | 19 // history::HistoryClient: |
| 20 virtual void BlockUntilBookmarksLoaded() OVERRIDE; |
| 21 virtual bool IsBookmarked(const GURL& url) OVERRIDE; |
| 22 virtual void GetBookmarks( |
| 23 std::vector<history::URLAndTitle>* bookmarks) OVERRIDE; |
| 24 |
| 25 // KeyedService: |
| 26 virtual void Shutdown() OVERRIDE; |
| 27 |
| 28 private: |
| 29 // The BookmarkModel, this should outlive ChromeHistoryClient. |
| 30 BookmarkModel* bookmark_model_; |
| 31 |
16 DISALLOW_COPY_AND_ASSIGN(ChromeHistoryClient); | 32 DISALLOW_COPY_AND_ASSIGN(ChromeHistoryClient); |
17 }; | 33 }; |
18 | 34 |
19 #endif // CHROME_BROWSER_HISTORY_CHROME_HISTORY_CLIENT_H_ | 35 #endif // CHROME_BROWSER_HISTORY_CHROME_HISTORY_CLIENT_H_ |
OLD | NEW |