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