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