| 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 COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_CLIENT_H_ | 5 #ifndef COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_CLIENT_H_ |
| 6 #define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_CLIENT_H_ | 6 #define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "components/search_engines/template_url_id.h" | 9 #include "components/search_engines/template_url_id.h" |
| 10 | 10 |
| 11 class GURL; | 11 class GURL; |
| 12 class TemplateURL; | 12 class TemplateURL; |
| 13 class TemplateURLService; | 13 class TemplateURLService; |
| 14 | 14 |
| 15 namespace base { |
| 16 class Value; |
| 17 } |
| 18 |
| 15 // This interface provides history related functionality required by | 19 // This interface provides history related functionality required by |
| 16 // TemplateURLService. | 20 // TemplateURLService. |
| 17 // TODO(hashimoto): Get rid of this once HistoryService gets componentized. | 21 // TODO(hashimoto): Get rid of this once HistoryService gets componentized. |
| 18 class TemplateURLServiceClient { | 22 class TemplateURLServiceClient { |
| 19 public: | 23 public: |
| 20 virtual ~TemplateURLServiceClient() {} | 24 virtual ~TemplateURLServiceClient() {} |
| 21 | 25 |
| 22 // Called by TemplateURLService::Shutdown as part of the two phase shutdown | 26 // Called by TemplateURLService::Shutdown as part of the two phase shutdown |
| 23 // of the KeyedService. | 27 // of the KeyedService. |
| 24 virtual void Shutdown() = 0; | 28 virtual void Shutdown() = 0; |
| 25 | 29 |
| 26 // Sets the pointer to the owner of this object. | 30 // Sets the pointer to the owner of this object. |
| 27 virtual void SetOwner(TemplateURLService* owner) = 0; | 31 virtual void SetOwner(TemplateURLService* owner) = 0; |
| 28 | 32 |
| 29 // Deletes all search terms for the specified keyword. | 33 // Deletes all search terms for the specified keyword. |
| 30 virtual void DeleteAllSearchTermsForKeyword(TemplateURLID id) = 0; | 34 virtual void DeleteAllSearchTermsForKeyword(TemplateURLID id) = 0; |
| 31 | 35 |
| 32 // Sets the search terms for the specified url and keyword. | 36 // Sets the search terms for the specified url and keyword. |
| 33 virtual void SetKeywordSearchTermsForURL(const GURL& url, | 37 virtual void SetKeywordSearchTermsForURL(const GURL& url, |
| 34 TemplateURLID id, | 38 TemplateURLID id, |
| 35 const base::string16& term) = 0; | 39 const base::string16& term) = 0; |
| 36 | 40 |
| 37 // Adds the given URL to history as a keyword generated visit. | 41 // Adds the given URL to history as a keyword generated visit. |
| 38 virtual void AddKeywordGeneratedVisit(const GURL& url) = 0; | 42 virtual void AddKeywordGeneratedVisit(const GURL& url) = 0; |
| 39 | 43 |
| 40 // Given the main search |url| for a TemplateURL, returns whether the | 44 // Given the main search |url| for a TemplateURL, returns whether the |
| 41 // TemplateURL is from an omnibox extension. | 45 // TemplateURL is from an omnibox extension. |
| 42 virtual bool IsOmniboxExtensionURL(const std::string& url) = 0; | 46 virtual bool IsOmniboxExtensionURL(const std::string& url) = 0; |
| 47 |
| 48 virtual void SetExtensionControlledPref( |
| 49 const std::string extension_id, const std::string pref_name, |
| 50 std::unique_ptr<base::Value> pref_value) = 0; |
| 43 }; | 51 }; |
| 44 | 52 |
| 45 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_CLIENT_H_ | 53 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_CLIENT_H_ |
| OLD | NEW |