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 "base/prefs/pref_change_registrar.h"
12 #include "chrome/browser/extensions/external_loader.h"
13 #include "content/public/browser/notification_observer.h"
14 #include "content/public/browser/notification_registrar.h"
19 class DictionaryValue
;
22 namespace extensions
{
24 // A specialization of the ExternalProvider that uses
25 // pref_names::kInstallForceList to look up which external extensions are
27 class ExternalPolicyLoader
28 : public ExternalLoader
,
29 public content::NotificationObserver
{
31 explicit ExternalPolicyLoader(Profile
* profile
);
33 // content::NotificationObserver implementation
34 virtual void Observe(int type
,
35 const content::NotificationSource
& source
,
36 const content::NotificationDetails
& details
) OVERRIDE
;
38 // Adds an extension to be updated to the pref dictionary.
39 static void AddExtension(base::DictionaryValue
* dict
,
40 const std::string
& extension_id
,
41 const std::string
& update_url
);
44 virtual void StartLoading() OVERRIDE
;
47 friend class base::RefCountedThreadSafe
<ExternalLoader
>;
49 virtual ~ExternalPolicyLoader() {}
51 PrefChangeRegistrar pref_change_registrar_
;
52 content::NotificationRegistrar notification_registrar_
;
56 DISALLOW_COPY_AND_ASSIGN(ExternalPolicyLoader
);
59 } // namespace extensions
61 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_POLICY_LOADER_H_