| 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 #include "components/history/core/browser/history_service_observer.h" | 10 #include "components/history/core/browser/history_service_observer.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 virtual bool ShouldReportDatabaseError() override; | 43 virtual bool ShouldReportDatabaseError() override; |
| 44 | 44 |
| 45 // KeyedService: | 45 // KeyedService: |
| 46 virtual void Shutdown() override; | 46 virtual void Shutdown() override; |
| 47 | 47 |
| 48 // HistoryServiceObserver: | 48 // HistoryServiceObserver: |
| 49 virtual void OnURLVisited(HistoryService* history_service, | 49 virtual void OnURLVisited(HistoryService* history_service, |
| 50 ui::PageTransition transition, | 50 ui::PageTransition transition, |
| 51 const history::URLRow& row, | 51 const history::URLRow& row, |
| 52 const history::RedirectList& redirects, | 52 const history::RedirectList& redirects, |
| 53 base::Time visit_time) OVERRIDE; | 53 base::Time visit_time) override; |
| 54 | 54 |
| 55 // TopSitesObserver: | 55 // TopSitesObserver: |
| 56 virtual void TopSitesLoaded(history::TopSites* top_sites) override; | 56 virtual void TopSitesLoaded(history::TopSites* top_sites) override; |
| 57 virtual void TopSitesChanged(history::TopSites* top_sites) override; | 57 virtual void TopSitesChanged(history::TopSites* top_sites) override; |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 // The BookmarkModel, this should outlive ChromeHistoryClient. | 60 // The BookmarkModel, this should outlive ChromeHistoryClient. |
| 61 BookmarkModel* bookmark_model_; | 61 BookmarkModel* bookmark_model_; |
| 62 Profile* profile_; | 62 Profile* profile_; |
| 63 HistoryService* history_service_; | 63 HistoryService* history_service_; |
| 64 // The TopSites object is owned by the Profile (see | 64 // The TopSites object is owned by the Profile (see |
| 65 // chrome/browser/profiles/profile_impl.h) | 65 // chrome/browser/profiles/profile_impl.h) |
| 66 // and lazily constructed by the getter. | 66 // and lazily constructed by the getter. |
| 67 // ChromeHistoryClient is a KeyedService linked to the Profile lifetime by the | 67 // ChromeHistoryClient is a KeyedService linked to the Profile lifetime by the |
| 68 // ChromeHistoryClientFactory (which is a BrowserContextKeyedServiceFactory). | 68 // ChromeHistoryClientFactory (which is a BrowserContextKeyedServiceFactory). |
| 69 // Before the Profile is destroyed, all the KeyedService Shutdown methods are | 69 // Before the Profile is destroyed, all the KeyedService Shutdown methods are |
| 70 // called, and the Profile is fully constructed before any of the KeyedService | 70 // called, and the Profile is fully constructed before any of the KeyedService |
| 71 // can be constructed. The TopSites does not use the HistoryService nor the | 71 // can be constructed. The TopSites does not use the HistoryService nor the |
| 72 // HistoryClient during construction (it uses it later, but supports getting | 72 // HistoryClient during construction (it uses it later, but supports getting |
| 73 // an NULL pointer). | 73 // an NULL pointer). |
| 74 history::TopSites* top_sites_; | 74 history::TopSites* top_sites_; |
| 75 | 75 |
| 76 DISALLOW_COPY_AND_ASSIGN(ChromeHistoryClient); | 76 DISALLOW_COPY_AND_ASSIGN(ChromeHistoryClient); |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 #endif // CHROME_BROWSER_HISTORY_CHROME_HISTORY_CLIENT_H_ | 79 #endif // CHROME_BROWSER_HISTORY_CHROME_HISTORY_CLIENT_H_ |
| OLD | NEW |