[Presentation API, Android] Implement basic messaging
[chromium-blink-merge.git] / chrome / browser / search_engines / chrome_template_url_service_client.h
blobc22bb45ee9b34755107a54091c1b8b5f37a876be
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 "base/scoped_observer.h"
9 #include "components/history/core/browser/history_service_observer.h"
10 #include "components/search_engines/template_url_service_client.h"
12 namespace history {
13 class HistoryService;
16 // ChromeTemplateURLServiceClient provides keyword related history
17 // functionality for TemplateURLService.
18 class ChromeTemplateURLServiceClient : public TemplateURLServiceClient,
19 public history::HistoryServiceObserver {
20 public:
21 explicit ChromeTemplateURLServiceClient(
22 history::HistoryService* history_service);
23 ~ChromeTemplateURLServiceClient() override;
25 // TemplateURLServiceClient:
26 void Shutdown() override;
27 void SetOwner(TemplateURLService* owner) override;
28 void DeleteAllSearchTermsForKeyword(history::KeywordID keyword_Id) override;
29 void SetKeywordSearchTermsForURL(const GURL& url,
30 TemplateURLID id,
31 const base::string16& term) override;
32 void AddKeywordGeneratedVisit(const GURL& url) override;
33 void RestoreExtensionInfoIfNecessary(TemplateURL* template_url) override;
35 // history::HistoryServiceObserver:
36 void OnURLVisited(history::HistoryService* history_service,
37 ui::PageTransition transition,
38 const history::URLRow& row,
39 const history::RedirectList& redirects,
40 base::Time visit_time) override;
42 private:
43 TemplateURLService* owner_;
44 ScopedObserver<history::HistoryService, history::HistoryServiceObserver>
45 history_service_observer_;
46 history::HistoryService* history_service_;
48 DISALLOW_COPY_AND_ASSIGN(ChromeTemplateURLServiceClient);
51 #endif // CHROME_BROWSER_SEARCH_ENGINES_CHROME_TEMPLATE_URL_SERVICE_CLIENT_H_