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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTERNAL_POLICY_LOADER_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_POLICY_LOADER_H_
10 #include "base/compiler_specific.h"
11 #include "chrome/browser/extensions/extension_management.h"
12 #include "chrome/browser/extensions/external_loader.h"
15 class DictionaryValue;
18 namespace extensions {
20 // A specialization of the ExternalProvider that uses extension management
21 // policies to look up which external extensions are registered.
22 class ExternalPolicyLoader : public ExternalLoader,
23 public ExtensionManagement::Observer {
25 explicit ExternalPolicyLoader(ExtensionManagement* settings);
27 // ExtensionManagement::Observer implementation
28 virtual void OnExtensionManagementSettingsChanged() OVERRIDE;
30 // Adds an extension to be updated to the pref dictionary.
31 static void AddExtension(base::DictionaryValue* dict,
32 const std::string& extension_id,
33 const std::string& update_url);
36 virtual void StartLoading() OVERRIDE;
39 friend class base::RefCountedThreadSafe<ExternalLoader>;
41 virtual ~ExternalPolicyLoader();
43 ExtensionManagement* settings_;
45 DISALLOW_COPY_AND_ASSIGN(ExternalPolicyLoader);
48 } // namespace extensions
50 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_POLICY_LOADER_H_