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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_CHROME_TEMPLATE_URL_SERVICE_CLIENT_H_
6 #define CHROME_BROWSER_SEARCH_ENGINES_CHROME_TEMPLATE_URL_SERVICE_CLIENT_H_
8 #include "components/history/core/browser/history_service_observer.h"
9 #include "components/search_engines/template_url_service_client.h"
13 // ChromeTemplateURLServiceClient provides keyword related history
14 // functionality for TemplateURLService.
15 class ChromeTemplateURLServiceClient
: public TemplateURLServiceClient
,
16 public history::HistoryServiceObserver
{
18 explicit ChromeTemplateURLServiceClient(HistoryService
* history_service
);
19 virtual ~ChromeTemplateURLServiceClient();
21 // TemplateURLServiceClient:
22 virtual void Shutdown() override
;
23 virtual void SetOwner(TemplateURLService
* owner
) override
;
24 virtual void DeleteAllSearchTermsForKeyword(
25 history::KeywordID keyword_Id
) override
;
26 virtual void SetKeywordSearchTermsForURL(const GURL
& url
,
28 const base::string16
& term
) override
;
29 virtual void AddKeywordGeneratedVisit(const GURL
& url
) override
;
30 virtual void RestoreExtensionInfoIfNecessary(
31 TemplateURL
* template_url
) override
;
33 // history::HistoryServiceObserver:
34 virtual void OnURLVisited(HistoryService
* history_service
,
35 ui::PageTransition transition
,
36 const history::URLRow
& row
,
37 const history::RedirectList
& redirects
,
38 base::Time visit_time
) override
;
41 TemplateURLService
* owner_
;
42 HistoryService
* history_service_
;
44 DISALLOW_COPY_AND_ASSIGN(ChromeTemplateURLServiceClient
);
47 #endif // CHROME_BROWSER_SEARCH_ENGINES_CHROME_TEMPLATE_URL_SERVICE_CLIENT_H_