Index: chrome/browser/search_engines/chrome_template_url_service_client.cc |
diff --git a/chrome/browser/search_engines/chrome_template_url_service_client.cc b/chrome/browser/search_engines/chrome_template_url_service_client.cc |
index 6653ee6c70a236ce8a5e0598ea359bea5e467670..9fa3a743c727e101ca18747f440222ebf8b1e8ee 100644 |
--- a/chrome/browser/search_engines/chrome_template_url_service_client.cc |
+++ b/chrome/browser/search_engines/chrome_template_url_service_client.cc |
@@ -6,14 +6,18 @@ |
#include "base/memory/ptr_util.h" |
#include "components/history/core/browser/history_service.h" |
+#include "components/search_engines/default_search_manager.h" |
#include "components/search_engines/template_url_service.h" |
+#include "extensions/browser/extension_pref_value_map.h" |
#include "extensions/common/constants.h" |
ChromeTemplateURLServiceClient::ChromeTemplateURLServiceClient( |
- history::HistoryService* history_service) |
+ history::HistoryService* history_service, |
+ ExtensionPrefValueMap* extension_prefs_value_map) |
: owner_(NULL), |
history_service_observer_(this), |
- history_service_(history_service) { |
+ history_service_(history_service), |
+ extension_prefs_value_map_(extension_prefs_value_map) { |
// TODO(sky): bug 1166191. The keywords should be moved into the history |
// db, which will mean we no longer need this notification and the history |
// backend can handle automatically adding the search terms as the user |
@@ -68,6 +72,13 @@ bool ChromeTemplateURLServiceClient::IsOmniboxExtensionURL( |
return GURL(url).SchemeIs(extensions::kExtensionScheme); |
} |
+std::string ChromeTemplateURLServiceClient::GetExtensionControllingDSEPref() { |
+ if (!extension_prefs_value_map_) |
+ return std::string(); // Can be null during testing. |
+ return extension_prefs_value_map_->GetExtensionControllingPref( |
+ DefaultSearchManager::kDefaultSearchProviderDataPrefName); |
+} |
+ |
void ChromeTemplateURLServiceClient::OnURLVisited( |
history::HistoryService* history_service, |
ui::PageTransition transition, |