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..48d46a63adaf22270a61802b7fa7a191a834d5f6 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,22 @@ class TemplateURLServiceTestUtil : public TemplateURLServiceObserver { |
// Sets the google base url. |base_url| must be valid. |
void SetGoogleBaseURL(const GURL& base_url); |
+ // Write default search engine into extension controlled preference in test |
+ // profile. |
+ void SetExtensionDefaultSearchInPrefs(const std::string& ext_id, |
+ const TemplateURLData& ext_data); |
+ // Remove extension controlled default search engine 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 +95,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); |
}; |