1 // Copyright (c) 2011 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. 4 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTERNAL_POLICY_EXTENSION_LOADER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_POLICY_EXTENSION_LOADER_H_ 7 #pragma once 8 9 #include "chrome/browser/extensions/external_extension_loader.h" 10 11 #include "chrome/browser/prefs/pref_change_registrar.h" 12 #include "content/common/notification_observer.h" 13 #include "content/common/notification_registrar.h" 14 15 class ListValue; 16 class MockExternalPolicyExtensionProviderVisitor; 17 class Profile; 18 19 // A specialization of the ExternalExtensionProvider that uses 20 // prefs::kExtensionInstallForceList to look up which external extensions are 21 // registered. 22 class ExternalPolicyExtensionLoader 23 : public ExternalExtensionLoader, 24 public NotificationObserver { 25 public: 26 explicit ExternalPolicyExtensionLoader(Profile* profile); 27 28 // NotificationObserver implementation 29 virtual void Observe(NotificationType type, 30 const NotificationSource& source, 31 const NotificationDetails& details); 32 33 protected: 34 virtual void StartLoading(); 35 36 private: 37 friend class base::RefCountedThreadSafe<ExternalExtensionLoader>; 38 39 virtual ~ExternalPolicyExtensionLoader() {} 40 41 PrefChangeRegistrar pref_change_registrar_; 42 NotificationRegistrar notification_registrar_; 43 44 Profile* profile_; 45 46 DISALLOW_COPY_AND_ASSIGN(ExternalPolicyExtensionLoader); 47 }; 48 49 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_POLICY_EXTENSION_LOADER_H_ 50