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/search_engines/template_url_service_client.h" | 8 #include "components/search_engines/template_url_service_client.h" |
9 #include "content/public/browser/notification_observer.h" | 9 #include "content/public/browser/notification_observer.h" |
10 #include "content/public/browser/notification_registrar.h" | 10 #include "content/public/browser/notification_registrar.h" |
11 | 11 |
12 class HistoryService; | 12 class HistoryService; |
13 class Profile; | 13 class Profile; |
14 | 14 |
15 // ChromeTemplateURLServiceClient provides keyword related history | 15 // ChromeTemplateURLServiceClient provides keyword related history |
16 // functionality for TemplateURLService. | 16 // functionality for TemplateURLService. |
17 class ChromeTemplateURLServiceClient : public TemplateURLServiceClient, | 17 class ChromeTemplateURLServiceClient : public TemplateURLServiceClient, |
18 public content::NotificationObserver { | 18 public content::NotificationObserver { |
19 public: | 19 public: |
20 explicit ChromeTemplateURLServiceClient(Profile* profile); | 20 explicit ChromeTemplateURLServiceClient(Profile* profile); |
21 virtual ~ChromeTemplateURLServiceClient(); | 21 virtual ~ChromeTemplateURLServiceClient(); |
22 | 22 |
23 // TemplateURLServiceClient: | 23 // TemplateURLServiceClient: |
24 virtual void SetOwner(TemplateURLService* owner) OVERRIDE; | 24 virtual void SetOwner(TemplateURLService* owner) override; |
25 virtual void DeleteAllSearchTermsForKeyword( | 25 virtual void DeleteAllSearchTermsForKeyword( |
26 history::KeywordID keyword_Id) OVERRIDE; | 26 history::KeywordID keyword_Id) override; |
27 virtual void SetKeywordSearchTermsForURL(const GURL& url, | 27 virtual void SetKeywordSearchTermsForURL(const GURL& url, |
28 TemplateURLID id, | 28 TemplateURLID id, |
29 const base::string16& term) OVERRIDE; | 29 const base::string16& term) override; |
30 virtual void AddKeywordGeneratedVisit(const GURL& url) OVERRIDE; | 30 virtual void AddKeywordGeneratedVisit(const GURL& url) override; |
31 virtual void RestoreExtensionInfoIfNecessary( | 31 virtual void RestoreExtensionInfoIfNecessary( |
32 TemplateURL* template_url) OVERRIDE; | 32 TemplateURL* template_url) override; |
33 | 33 |
34 // content::NotificationObserver: | 34 // content::NotificationObserver: |
35 virtual void Observe(int type, | 35 virtual void Observe(int type, |
36 const content::NotificationSource& source, | 36 const content::NotificationSource& source, |
37 const content::NotificationDetails& details) OVERRIDE; | 37 const content::NotificationDetails& details) override; |
38 | 38 |
39 private: | 39 private: |
40 Profile* profile_; | 40 Profile* profile_; |
41 TemplateURLService* owner_; | 41 TemplateURLService* owner_; |
42 content::NotificationRegistrar notification_registrar_; | 42 content::NotificationRegistrar notification_registrar_; |
43 | 43 |
44 DISALLOW_COPY_AND_ASSIGN(ChromeTemplateURLServiceClient); | 44 DISALLOW_COPY_AND_ASSIGN(ChromeTemplateURLServiceClient); |
45 }; | 45 }; |
46 | 46 |
47 #endif // CHROME_BROWSER_SEARCH_ENGINES_CHROME_TEMPLATE_URL_SERVICE_CLIENT_H_ | 47 #endif // CHROME_BROWSER_SEARCH_ENGINES_CHROME_TEMPLATE_URL_SERVICE_CLIENT_H_ |
OLD | NEW |