Chromium Code Reviews| 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 "chrome/browser/history/top_sites_observer.h" | |
| 9 #include "components/history/core/browser/history_client.h" | 10 #include "components/history/core/browser/history_client.h" |
| 10 | 11 |
| 11 class BookmarkModel; | 12 class BookmarkModel; |
| 12 | 13 |
| 14 namespace history { | |
| 15 class TopSites; | |
| 16 } | |
| 17 | |
| 13 // This class implements history::HistoryClient to abstract operations that | 18 // This class implements history::HistoryClient to abstract operations that |
| 14 // depend on Chrome environment. | 19 // depend on Chrome environment. |
| 15 class ChromeHistoryClient : public history::HistoryClient { | 20 class ChromeHistoryClient : public history::HistoryClient, |
| 21 public TopSitesObserver { | |
| 16 public: | 22 public: |
| 17 explicit ChromeHistoryClient(BookmarkModel* bookmark_model); | 23 explicit ChromeHistoryClient(BookmarkModel* bookmark_model, |
|
sdefresne
2014/08/04 08:47:18
Add the Profile as an additional parameter.
nshaik
2014/08/05 06:38:03
Done.
| |
| 24 history::TopSites* top_sites); | |
| 25 virtual ~ChromeHistoryClient(); | |
| 18 | 26 |
| 19 // history::HistoryClient: | 27 // history::HistoryClient: |
| 20 virtual void BlockUntilBookmarksLoaded() OVERRIDE; | 28 virtual void BlockUntilBookmarksLoaded() OVERRIDE; |
| 21 virtual bool IsBookmarked(const GURL& url) OVERRIDE; | 29 virtual bool IsBookmarked(const GURL& url) OVERRIDE; |
| 22 virtual void GetBookmarks( | 30 virtual void GetBookmarks( |
| 23 std::vector<history::URLAndTitle>* bookmarks) OVERRIDE; | 31 std::vector<history::URLAndTitle>* bookmarks) OVERRIDE; |
| 24 virtual void NotifyProfileError(sql::InitStatus init_status) OVERRIDE; | 32 virtual void NotifyProfileError(sql::InitStatus init_status) OVERRIDE; |
| 25 virtual bool ShouldReportDatabaseError() OVERRIDE; | 33 virtual bool ShouldReportDatabaseError() OVERRIDE; |
| 26 | 34 |
| 27 // KeyedService: | 35 // KeyedService: |
| 28 virtual void Shutdown() OVERRIDE; | 36 virtual void Shutdown() OVERRIDE; |
| 29 | 37 |
| 38 // TopSitesObserver: | |
| 39 virtual void TopSitesLoaded(history::TopSites* top_sites) OVERRIDE; | |
| 40 virtual void TopSitesChanged(history::TopSites* top_sites) OVERRIDE; | |
| 41 | |
| 30 private: | 42 private: |
| 31 // The BookmarkModel, this should outlive ChromeHistoryClient. | 43 // The BookmarkModel, this should outlive ChromeHistoryClient. |
| 32 BookmarkModel* bookmark_model_; | 44 BookmarkModel* bookmark_model_; |
| 45 history::TopSites* top_sites_; | |
| 33 | 46 |
| 34 DISALLOW_COPY_AND_ASSIGN(ChromeHistoryClient); | 47 DISALLOW_COPY_AND_ASSIGN(ChromeHistoryClient); |
| 35 }; | 48 }; |
| 36 | 49 |
| 37 #endif // CHROME_BROWSER_HISTORY_CHROME_HISTORY_CLIENT_H_ | 50 #endif // CHROME_BROWSER_HISTORY_CHROME_HISTORY_CLIENT_H_ |
| OLD | NEW |