Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / search_engines / chrome_template_url_service_client.h
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.
4
5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_CHROME_TEMPLATE_URL_SERVICE_CLIENT_H_
6 #define CHROME_BROWSER_SEARCH_ENGINES_CHROME_TEMPLATE_URL_SERVICE_CLIENT_H_
7
8 #include "components/history/core/browser/history_service_observer.h"
9 #include "components/search_engines/template_url_service_client.h"
10
11 class HistoryService;
12
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   ~ChromeTemplateURLServiceClient() override;
20
21   // TemplateURLServiceClient:
22   void Shutdown() override;
23   void SetOwner(TemplateURLService* owner) override;
24   void DeleteAllSearchTermsForKeyword(history::KeywordID keyword_Id) override;
25   void SetKeywordSearchTermsForURL(const GURL& url,
26                                    TemplateURLID id,
27                                    const base::string16& term) override;
28   void AddKeywordGeneratedVisit(const GURL& url) override;
29   void RestoreExtensionInfoIfNecessary(TemplateURL* template_url) override;
30
31   // history::HistoryServiceObserver:
32   void OnURLVisited(HistoryService* history_service,
33                     ui::PageTransition transition,
34                     const history::URLRow& row,
35                     const history::RedirectList& redirects,
36                     base::Time visit_time) override;
37
38  private:
39   TemplateURLService* owner_;
40   HistoryService* history_service_;
41
42   DISALLOW_COPY_AND_ASSIGN(ChromeTemplateURLServiceClient);
43 };
44
45 #endif  // CHROME_BROWSER_SEARCH_ENGINES_CHROME_TEMPLATE_URL_SERVICE_CLIENT_H_