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 <stddef.h> | 7 #include <stddef.h> |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 UnsetPref(extension->id(), prefs::kDefaultSearchProviderEnabled); | 190 UnsetPref(extension->id(), prefs::kDefaultSearchProviderEnabled); |
191 } | 191 } |
192 DCHECK(url_service_); | 192 DCHECK(url_service_); |
193 RegisterSearchProvider(extension); | 193 RegisterSearchProvider(extension); |
194 } | 194 } |
195 } | 195 } |
196 } | 196 } |
197 void SettingsOverridesAPI::OnExtensionUnloaded( | 197 void SettingsOverridesAPI::OnExtensionUnloaded( |
198 content::BrowserContext* browser_context, | 198 content::BrowserContext* browser_context, |
199 const Extension* extension, | 199 const Extension* extension, |
200 UnloadedExtensionInfo::Reason reason) { | 200 UnloadedExtensionReason reason) { |
201 const SettingsOverrides* settings = SettingsOverrides::Get(extension); | 201 const SettingsOverrides* settings = SettingsOverrides::Get(extension); |
202 if (settings) { | 202 if (settings) { |
203 if (settings->homepage) { | 203 if (settings->homepage) { |
204 UnsetPref(extension->id(), prefs::kHomePage); | 204 UnsetPref(extension->id(), prefs::kHomePage); |
205 UnsetPref(extension->id(), prefs::kHomePageIsNewTabPage); | 205 UnsetPref(extension->id(), prefs::kHomePageIsNewTabPage); |
206 } | 206 } |
207 if (!settings->startup_pages.empty()) { | 207 if (!settings->startup_pages.empty()) { |
208 UnsetPref(extension->id(), prefs::kRestoreOnStartup); | 208 UnsetPref(extension->id(), prefs::kRestoreOnStartup); |
209 UnsetPref(extension->id(), prefs::kURLsToRestoreOnStartup); | 209 UnsetPref(extension->id(), prefs::kURLsToRestoreOnStartup); |
210 } | 210 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 | 250 |
251 template <> | 251 template <> |
252 void BrowserContextKeyedAPIFactory< | 252 void BrowserContextKeyedAPIFactory< |
253 SettingsOverridesAPI>::DeclareFactoryDependencies() { | 253 SettingsOverridesAPI>::DeclareFactoryDependencies() { |
254 DependsOn(ExtensionPrefsFactory::GetInstance()); | 254 DependsOn(ExtensionPrefsFactory::GetInstance()); |
255 DependsOn(PreferenceAPI::GetFactoryInstance()); | 255 DependsOn(PreferenceAPI::GetFactoryInstance()); |
256 DependsOn(TemplateURLServiceFactory::GetInstance()); | 256 DependsOn(TemplateURLServiceFactory::GetInstance()); |
257 } | 257 } |
258 | 258 |
259 } // namespace extensions | 259 } // namespace extensions |
OLD | NEW |