Chromium Code Reviews| Index: chrome/browser/search_engines/template_url_service_test_util.h |
| diff --git a/chrome/browser/search_engines/template_url_service_test_util.h b/chrome/browser/search_engines/template_url_service_test_util.h |
| index 566fb9215b536f1128a7ca0eb5b14ec9713568fa..7f9919e53bfba236847f1e78e2b6da14393d5ec0 100644 |
| --- a/chrome/browser/search_engines/template_url_service_test_util.h |
| +++ b/chrome/browser/search_engines/template_url_service_test_util.h |
| @@ -12,9 +12,11 @@ |
| #include "base/macros.h" |
| #include "base/memory/ref_counted.h" |
| #include "base/strings/string16.h" |
| +#include "components/search_engines/template_url.h" |
| #include "components/search_engines/template_url_data.h" |
| #include "components/search_engines/template_url_service_observer.h" |
| +class ExtensionPrefValueMap; |
| class GURL; |
| class KeywordWebDataService; |
| class TemplateURLService; |
| @@ -65,6 +67,20 @@ class TemplateURLServiceTestUtil : public TemplateURLServiceObserver { |
| // Sets the google base url. |base_url| must be valid. |
| void SetGoogleBaseURL(const GURL& base_url); |
| + // Write DSE into extension controlled preference in test profile. |
|
vasilii
2016/12/06 19:16:42
Please expand the DSE.
Alexander Yashkin
2016/12/09 08:19:52
Done
|
| + void SetExtensionDefaultSearchInPrefs(const std::string& ext_id, |
| + const TemplateURLData& ext_data); |
| + // Remove extension controlled DSE preference from test profile. |
| + void RemoveExtensionDefaultSearchFromPrefs(const std::string& ext_id); |
| + |
| + // Add extension turl to model and override default search preference if |
| + // extension wants to be default. |
| + TemplateURL* AddExtensionControlledTURL( |
| + std::unique_ptr<TemplateURL> ext_dse, |
| + std::unique_ptr<TemplateURL::AssociatedExtensionInfo> ext_info); |
| + // Remove extension turl from preferences and model. |
| + void RemoveExtensionControlledTURL(const std::string& ext_id); |
| + |
| KeywordWebDataService* web_data_service() { return web_data_service_.get(); } |
| TemplateURLService* model() { return model_.get(); } |
| TestingProfile* profile() { return profile_.get(); } |
| @@ -77,6 +93,7 @@ class TemplateURLServiceTestUtil : public TemplateURLServiceObserver { |
| scoped_refptr<KeywordWebDataService> web_data_service_; |
| TestingSearchTermsData* search_terms_data_; |
| std::unique_ptr<TemplateURLService> model_; |
| + std::unique_ptr<ExtensionPrefValueMap> ext_pref_map_; |
| DISALLOW_COPY_AND_ASSIGN(TemplateURLServiceTestUtil); |
| }; |