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_SEARCH_ENGINES_CHROME_TEMPLATE_URL_SERVICE_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_CHROME_TEMPLATE_URL_SERVICE_CLIENT_H_ |
6 #define CHROME_BROWSER_SEARCH_ENGINES_CHROME_TEMPLATE_URL_SERVICE_CLIENT_H_ | 6 #define CHROME_BROWSER_SEARCH_ENGINES_CHROME_TEMPLATE_URL_SERVICE_CLIENT_H_ |
7 | 7 |
| 8 #include "base/scoped_observer.h" |
8 #include "components/history/core/browser/history_service_observer.h" | 9 #include "components/history/core/browser/history_service_observer.h" |
9 #include "components/search_engines/template_url_service_client.h" | 10 #include "components/search_engines/template_url_service_client.h" |
10 | 11 |
11 class HistoryService; | 12 class HistoryService; |
12 | 13 |
13 // ChromeTemplateURLServiceClient provides keyword related history | 14 // ChromeTemplateURLServiceClient provides keyword related history |
14 // functionality for TemplateURLService. | 15 // functionality for TemplateURLService. |
15 class ChromeTemplateURLServiceClient : public TemplateURLServiceClient, | 16 class ChromeTemplateURLServiceClient : public TemplateURLServiceClient, |
16 public history::HistoryServiceObserver { | 17 public history::HistoryServiceObserver { |
17 public: | 18 public: |
(...skipping 12 matching lines...) Expand all Loading... |
30 | 31 |
31 // history::HistoryServiceObserver: | 32 // history::HistoryServiceObserver: |
32 void OnURLVisited(HistoryService* history_service, | 33 void OnURLVisited(HistoryService* history_service, |
33 ui::PageTransition transition, | 34 ui::PageTransition transition, |
34 const history::URLRow& row, | 35 const history::URLRow& row, |
35 const history::RedirectList& redirects, | 36 const history::RedirectList& redirects, |
36 base::Time visit_time) override; | 37 base::Time visit_time) override; |
37 | 38 |
38 private: | 39 private: |
39 TemplateURLService* owner_; | 40 TemplateURLService* owner_; |
| 41 ScopedObserver<HistoryService, HistoryServiceObserver> |
| 42 history_service_observer_; |
40 HistoryService* history_service_; | 43 HistoryService* history_service_; |
41 | 44 |
42 DISALLOW_COPY_AND_ASSIGN(ChromeTemplateURLServiceClient); | 45 DISALLOW_COPY_AND_ASSIGN(ChromeTemplateURLServiceClient); |
43 }; | 46 }; |
44 | 47 |
45 #endif // CHROME_BROWSER_SEARCH_ENGINES_CHROME_TEMPLATE_URL_SERVICE_CLIENT_H_ | 48 #endif // CHROME_BROWSER_SEARCH_ENGINES_CHROME_TEMPLATE_URL_SERVICE_CLIENT_H_ |
OLD | NEW |