| 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..8ca2ccf072c93aef0996d3ef87f7c21f573de5f9 100644
|
| --- a/chrome/browser/search_engines/chrome_template_url_service_client.cc
|
| +++ b/chrome/browser/search_engines/chrome_template_url_service_client.cc
|
| @@ -5,15 +5,18 @@
|
| #include "chrome/browser/search_engines/chrome_template_url_service_client.h"
|
|
|
| #include "base/memory/ptr_util.h"
|
| +#include "chrome/browser/extensions/api/preference/preference_api.h"
|
| #include "components/history/core/browser/history_service.h"
|
| #include "components/search_engines/template_url_service.h"
|
| #include "extensions/common/constants.h"
|
|
|
| ChromeTemplateURLServiceClient::ChromeTemplateURLServiceClient(
|
| - history::HistoryService* history_service)
|
| + history::HistoryService* history_service,
|
| + extensions::PreferenceAPI* pref_api)
|
| : owner_(NULL),
|
| history_service_observer_(this),
|
| - history_service_(history_service) {
|
| + history_service_(history_service),
|
| + pref_api_(pref_api) {
|
| // 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
|
| @@ -84,3 +87,14 @@ void ChromeTemplateURLServiceClient::OnURLVisited(
|
| ui::PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_KEYWORD);
|
| owner_->OnHistoryURLVisited(visited_details);
|
| }
|
| +
|
| +void ChromeTemplateURLServiceClient::SetExtensionControlledPref(
|
| + const std::string extension_id, const std::string pref_name,
|
| + std::unique_ptr<base::Value> pref_value) {
|
| + if (!pref_api_)
|
| + return;
|
| + pref_api_->SetExtensionControlledPref(extension_id,
|
| + pref_name,
|
| + extensions::kExtensionPrefsScopeRegular,
|
| + pref_value.release());
|
| +}
|
|
|