| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/scoped_observer.h" | 9 #include "base/scoped_observer.h" |
| 10 #include "components/history/core/browser/history_service_observer.h" | 10 #include "components/history/core/browser/history_service_observer.h" |
| 11 #include "components/search_engines/template_url_service_client.h" | 11 #include "components/search_engines/template_url_service_client.h" |
| 12 | 12 |
| 13 namespace history { | 13 namespace history { |
| 14 class HistoryService; | 14 class HistoryService; |
| 15 } | 15 } |
| 16 | 16 |
| 17 class ExtensionPrefValueMap; |
| 18 |
| 17 // ChromeTemplateURLServiceClient provides keyword related history | 19 // ChromeTemplateURLServiceClient provides keyword related history |
| 18 // functionality for TemplateURLService. | 20 // functionality for TemplateURLService. |
| 19 class ChromeTemplateURLServiceClient : public TemplateURLServiceClient, | 21 class ChromeTemplateURLServiceClient : public TemplateURLServiceClient, |
| 20 public history::HistoryServiceObserver { | 22 public history::HistoryServiceObserver { |
| 21 public: | 23 public: |
| 22 explicit ChromeTemplateURLServiceClient( | 24 ChromeTemplateURLServiceClient( |
| 23 history::HistoryService* history_service); | 25 history::HistoryService* history_service, |
| 26 ExtensionPrefValueMap* extension_prefs_value_map); |
| 24 ~ChromeTemplateURLServiceClient() override; | 27 ~ChromeTemplateURLServiceClient() override; |
| 25 | 28 |
| 26 // TemplateURLServiceClient: | 29 // TemplateURLServiceClient: |
| 27 void Shutdown() override; | 30 void Shutdown() override; |
| 28 void SetOwner(TemplateURLService* owner) override; | 31 void SetOwner(TemplateURLService* owner) override; |
| 29 void DeleteAllSearchTermsForKeyword(history::KeywordID keyword_Id) override; | 32 void DeleteAllSearchTermsForKeyword(history::KeywordID keyword_Id) override; |
| 30 void SetKeywordSearchTermsForURL(const GURL& url, | 33 void SetKeywordSearchTermsForURL(const GURL& url, |
| 31 TemplateURLID id, | 34 TemplateURLID id, |
| 32 const base::string16& term) override; | 35 const base::string16& term) override; |
| 33 void AddKeywordGeneratedVisit(const GURL& url) override; | 36 void AddKeywordGeneratedVisit(const GURL& url) override; |
| 34 bool IsOmniboxExtensionURL(const std::string& url) override; | 37 bool IsOmniboxExtensionURL(const std::string& url) override; |
| 38 std::string GetExtensionControllingDSEPref() override; |
| 35 | 39 |
| 36 // history::HistoryServiceObserver: | 40 // history::HistoryServiceObserver: |
| 37 void OnURLVisited(history::HistoryService* history_service, | 41 void OnURLVisited(history::HistoryService* history_service, |
| 38 ui::PageTransition transition, | 42 ui::PageTransition transition, |
| 39 const history::URLRow& row, | 43 const history::URLRow& row, |
| 40 const history::RedirectList& redirects, | 44 const history::RedirectList& redirects, |
| 41 base::Time visit_time) override; | 45 base::Time visit_time) override; |
| 42 | 46 |
| 43 private: | 47 private: |
| 44 TemplateURLService* owner_; | 48 TemplateURLService* owner_; |
| 45 ScopedObserver<history::HistoryService, history::HistoryServiceObserver> | 49 ScopedObserver<history::HistoryService, history::HistoryServiceObserver> |
| 46 history_service_observer_; | 50 history_service_observer_; |
| 47 history::HistoryService* history_service_; | 51 history::HistoryService* history_service_; |
| 52 ExtensionPrefValueMap* extension_prefs_value_map_; |
| 48 | 53 |
| 49 DISALLOW_COPY_AND_ASSIGN(ChromeTemplateURLServiceClient); | 54 DISALLOW_COPY_AND_ASSIGN(ChromeTemplateURLServiceClient); |
| 50 }; | 55 }; |
| 51 | 56 |
| 52 #endif // CHROME_BROWSER_SEARCH_ENGINES_CHROME_TEMPLATE_URL_SERVICE_CLIENT_H_ | 57 #endif // CHROME_BROWSER_SEARCH_ENGINES_CHROME_TEMPLATE_URL_SERVICE_CLIENT_H_ |
| OLD | NEW |