| 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/extensions/api/preference/preference_api.h" | 9 #include "chrome/browser/extensions/api/preference/preference_api.h" |
| 10 #include "chrome/browser/prefs/session_startup_pref.h" | 10 #include "chrome/browser/prefs/session_startup_pref.h" |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 DCHECK(settings->search_engine); | 263 DCHECK(settings->search_engine); |
| 264 scoped_ptr<AssociatedExtensionInfo> info(new AssociatedExtensionInfo); | 264 scoped_ptr<AssociatedExtensionInfo> info(new AssociatedExtensionInfo); |
| 265 info->extension_id = extension->id(); | 265 info->extension_id = extension->id(); |
| 266 info->wants_to_be_default_engine = settings->search_engine->is_default; | 266 info->wants_to_be_default_engine = settings->search_engine->is_default; |
| 267 ExtensionPrefs* prefs = ExtensionPrefs::Get(profile_); | 267 ExtensionPrefs* prefs = ExtensionPrefs::Get(profile_); |
| 268 info->install_time = prefs->GetInstallTime(extension->id()); | 268 info->install_time = prefs->GetInstallTime(extension->id()); |
| 269 std::string install_parameter = prefs->GetInstallParam(extension->id()); | 269 std::string install_parameter = prefs->GetInstallParam(extension->id()); |
| 270 TemplateURLData data = ConvertSearchProvider( | 270 TemplateURLData data = ConvertSearchProvider( |
| 271 profile_->GetPrefs(), *settings->search_engine, install_parameter); | 271 profile_->GetPrefs(), *settings->search_engine, install_parameter); |
| 272 data.show_in_default_list = info->wants_to_be_default_engine; | 272 data.show_in_default_list = info->wants_to_be_default_engine; |
| 273 url_service_->AddExtensionControlledTURL(new TemplateURL(profile_, data), | 273 url_service_->AddExtensionControlledTURL(new TemplateURL(data), info.Pass()); |
| 274 info.Pass()); | |
| 275 } | 274 } |
| 276 | 275 |
| 277 template <> | 276 template <> |
| 278 void BrowserContextKeyedAPIFactory< | 277 void BrowserContextKeyedAPIFactory< |
| 279 SettingsOverridesAPI>::DeclareFactoryDependencies() { | 278 SettingsOverridesAPI>::DeclareFactoryDependencies() { |
| 280 DependsOn(ExtensionPrefsFactory::GetInstance()); | 279 DependsOn(ExtensionPrefsFactory::GetInstance()); |
| 281 DependsOn(PreferenceAPI::GetFactoryInstance()); | 280 DependsOn(PreferenceAPI::GetFactoryInstance()); |
| 282 DependsOn(TemplateURLServiceFactory::GetInstance()); | 281 DependsOn(TemplateURLServiceFactory::GetInstance()); |
| 283 } | 282 } |
| 284 | 283 |
| 285 } // namespace extensions | 284 } // namespace extensions |
| OLD | NEW |