1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/extensions/external_policy_loader.h"
7 #include "base/logging.h"
8 #include "base/strings/stringprintf.h"
9 #include "base/values.h"
10 #include "chrome/browser/extensions/external_provider_impl.h"
12 namespace extensions
{
14 ExternalPolicyLoader::ExternalPolicyLoader(ExtensionManagement
* settings
,
15 InstallationType type
)
16 : settings_(settings
), type_(type
) {
17 settings_
->AddObserver(this);
20 ExternalPolicyLoader::~ExternalPolicyLoader() {
21 settings_
->RemoveObserver(this);
24 void ExternalPolicyLoader::OnExtensionManagementSettingsChanged() {
29 void ExternalPolicyLoader::AddExtension(base::DictionaryValue
* dict
,
30 const std::string
& extension_id
,
31 const std::string
& update_url
) {
32 dict
->SetString(base::StringPrintf("%s.%s", extension_id
.c_str(),
33 ExternalProviderImpl::kExternalUpdateUrl
),
37 void ExternalPolicyLoader::StartLoading() {
40 prefs_
= settings_
->GetForceInstallList();
43 prefs_
= settings_
->GetRecommendedInstallList();
49 } // namespace extensions