| 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 "components/history/core/browser/history_service_observer.h" | 8 #include "components/history/core/browser/history_service_observer.h" |
| 9 #include "components/search_engines/template_url_service_client.h" | 9 #include "components/search_engines/template_url_service_client.h" |
| 10 | 10 |
| 11 class HistoryService; | 11 class HistoryService; |
| 12 | 12 |
| 13 // ChromeTemplateURLServiceClient provides keyword related history | 13 // ChromeTemplateURLServiceClient provides keyword related history |
| 14 // functionality for TemplateURLService. | 14 // functionality for TemplateURLService. |
| 15 class ChromeTemplateURLServiceClient : public TemplateURLServiceClient, | 15 class ChromeTemplateURLServiceClient : public TemplateURLServiceClient, |
| 16 public history::HistoryServiceObserver { | 16 public history::HistoryServiceObserver { |
| 17 public: | 17 public: |
| 18 explicit ChromeTemplateURLServiceClient(HistoryService* history_service); | 18 explicit ChromeTemplateURLServiceClient(HistoryService* history_service); |
| 19 virtual ~ChromeTemplateURLServiceClient(); | 19 ~ChromeTemplateURLServiceClient() override; |
| 20 | 20 |
| 21 // TemplateURLServiceClient: | 21 // TemplateURLServiceClient: |
| 22 virtual void Shutdown() override; | 22 void Shutdown() override; |
| 23 virtual void SetOwner(TemplateURLService* owner) override; | 23 void SetOwner(TemplateURLService* owner) override; |
| 24 virtual void DeleteAllSearchTermsForKeyword( | 24 void DeleteAllSearchTermsForKeyword(history::KeywordID keyword_Id) override; |
| 25 history::KeywordID keyword_Id) override; | 25 void SetKeywordSearchTermsForURL(const GURL& url, |
| 26 virtual void SetKeywordSearchTermsForURL(const GURL& url, | 26 TemplateURLID id, |
| 27 TemplateURLID id, | 27 const base::string16& term) override; |
| 28 const base::string16& term) override; | 28 void AddKeywordGeneratedVisit(const GURL& url) override; |
| 29 virtual void AddKeywordGeneratedVisit(const GURL& url) override; | 29 void RestoreExtensionInfoIfNecessary(TemplateURL* template_url) override; |
| 30 virtual void RestoreExtensionInfoIfNecessary( | |
| 31 TemplateURL* template_url) override; | |
| 32 | 30 |
| 33 // history::HistoryServiceObserver: | 31 // history::HistoryServiceObserver: |
| 34 virtual void OnURLVisited(HistoryService* history_service, | 32 void OnURLVisited(HistoryService* history_service, |
| 35 ui::PageTransition transition, | 33 ui::PageTransition transition, |
| 36 const history::URLRow& row, | 34 const history::URLRow& row, |
| 37 const history::RedirectList& redirects, | 35 const history::RedirectList& redirects, |
| 38 base::Time visit_time) override; | 36 base::Time visit_time) override; |
| 39 | 37 |
| 40 private: | 38 private: |
| 41 TemplateURLService* owner_; | 39 TemplateURLService* owner_; |
| 42 HistoryService* history_service_; | 40 HistoryService* history_service_; |
| 43 | 41 |
| 44 DISALLOW_COPY_AND_ASSIGN(ChromeTemplateURLServiceClient); | 42 DISALLOW_COPY_AND_ASSIGN(ChromeTemplateURLServiceClient); |
| 45 }; | 43 }; |
| 46 | 44 |
| 47 #endif // CHROME_BROWSER_SEARCH_ENGINES_CHROME_TEMPLATE_URL_SERVICE_CLIENT_H_ | 45 #endif // CHROME_BROWSER_SEARCH_ENGINES_CHROME_TEMPLATE_URL_SERVICE_CLIENT_H_ |
| OLD | NEW |