Adding instrumentation to locate the source of jankiness
[chromium-blink-merge.git] / chrome / browser / search_engines / chrome_template_url_service_client.h
blob877e5adefbbceaaeae2c6c442811e2611f78b06e
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"
11 class HistoryService;
13 // ChromeTemplateURLServiceClient provides keyword related history
14 // functionality for TemplateURLService.
15 class ChromeTemplateURLServiceClient : public TemplateURLServiceClient,
16 public history::HistoryServiceObserver {
17 public:
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,
27 TemplateURLID id,
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;
40 private:
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_