| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "chrome/browser/extensions/api/settings_overrides/settings_overrides_ap
i.h" | 5 #include "chrome/browser/extensions/api/settings_overrides/settings_overrides_ap
i.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/extensions/api/preference/preference_api.h" | 10 #include "chrome/browser/extensions/api/preference/preference_api.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 content::Source<Profile>(profile)); | 77 content::Source<Profile>(profile)); |
| 78 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, | 78 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, |
| 79 content::Source<Profile>(profile)); | 79 content::Source<Profile>(profile)); |
| 80 } | 80 } |
| 81 | 81 |
| 82 SettingsOverridesAPI::~SettingsOverridesAPI() { | 82 SettingsOverridesAPI::~SettingsOverridesAPI() { |
| 83 } | 83 } |
| 84 | 84 |
| 85 ProfileKeyedAPIFactory<SettingsOverridesAPI>* | 85 ProfileKeyedAPIFactory<SettingsOverridesAPI>* |
| 86 SettingsOverridesAPI::GetFactoryInstance() { | 86 SettingsOverridesAPI::GetFactoryInstance() { |
| 87 return &g_factory.Get(); | 87 return g_factory.Pointer(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void SettingsOverridesAPI::SetPref(const std::string& extension_id, | 90 void SettingsOverridesAPI::SetPref(const std::string& extension_id, |
| 91 const std::string& pref_key, | 91 const std::string& pref_key, |
| 92 base::Value* value) { | 92 base::Value* value) { |
| 93 PreferenceAPI::Get(profile_)->SetExtensionControlledPref( | 93 PreferenceAPI::Get(profile_)->SetExtensionControlledPref( |
| 94 extension_id, | 94 extension_id, |
| 95 pref_key, | 95 pref_key, |
| 96 kExtensionPrefsScopeRegular, | 96 kExtensionPrefsScopeRegular, |
| 97 value); | 97 value); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 | 219 |
| 220 template <> | 220 template <> |
| 221 void ProfileKeyedAPIFactory<SettingsOverridesAPI>:: | 221 void ProfileKeyedAPIFactory<SettingsOverridesAPI>:: |
| 222 DeclareFactoryDependencies() { | 222 DeclareFactoryDependencies() { |
| 223 DependsOn(ExtensionPrefsFactory::GetInstance()); | 223 DependsOn(ExtensionPrefsFactory::GetInstance()); |
| 224 DependsOn(PreferenceAPI::GetFactoryInstance()); | 224 DependsOn(PreferenceAPI::GetFactoryInstance()); |
| 225 DependsOn(TemplateURLServiceFactory::GetInstance()); | 225 DependsOn(TemplateURLServiceFactory::GetInstance()); |
| 226 } | 226 } |
| 227 | 227 |
| 228 } // namespace extensions | 228 } // namespace extensions |
| OLD | NEW |