| 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_CHROMEOS_ENTERPRISE_EXTENSION_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ENTERPRISE_EXTENSION_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_ENTERPRISE_EXTENSION_OBSERVER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ENTERPRISE_EXTENSION_OBSERVER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/common/extensions/extension.h" | 9 #include "chrome/common/extensions/extension.h" |
| 10 #include "content/common/content_notification_types.h" |
| 10 #include "content/common/notification_details.h" | 11 #include "content/common/notification_details.h" |
| 11 #include "content/common/notification_observer.h" | 12 #include "content/common/notification_observer.h" |
| 12 #include "content/common/notification_registrar.h" | 13 #include "content/common/notification_registrar.h" |
| 13 #include "content/common/notification_source.h" | 14 #include "content/common/notification_source.h" |
| 14 #include "content/common/notification_type.h" | |
| 15 | 15 |
| 16 class FilePath; | 16 class FilePath; |
| 17 class Profile; | 17 class Profile; |
| 18 | 18 |
| 19 namespace chromeos { | 19 namespace chromeos { |
| 20 | 20 |
| 21 // This observer listens for installed extensions and restarts the ChromeOS | 21 // This observer listens for installed extensions and restarts the ChromeOS |
| 22 // Enterprise daemon if an Enterprise Extension gets installed. | 22 // Enterprise daemon if an Enterprise Extension gets installed. |
| 23 class EnterpriseExtensionObserver | 23 class EnterpriseExtensionObserver |
| 24 : public NotificationObserver { | 24 : public NotificationObserver { |
| 25 public: | 25 public: |
| 26 explicit EnterpriseExtensionObserver(Profile* profile); | 26 explicit EnterpriseExtensionObserver(Profile* profile); |
| 27 virtual ~EnterpriseExtensionObserver() {} | 27 virtual ~EnterpriseExtensionObserver() {} |
| 28 | 28 |
| 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 private: | 33 private: |
| 34 static void CheckExtensionAndNotifyEntd(const FilePath& path); | 34 static void CheckExtensionAndNotifyEntd(const FilePath& path); |
| 35 static void NotifyEntd(); | 35 static void NotifyEntd(); |
| 36 | 36 |
| 37 Profile* profile_; | 37 Profile* profile_; |
| 38 NotificationRegistrar registrar_; | 38 NotificationRegistrar registrar_; |
| 39 | 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(EnterpriseExtensionObserver); | 40 DISALLOW_COPY_AND_ASSIGN(EnterpriseExtensionObserver); |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 } // namespace chromeos | 43 } // namespace chromeos |
| 44 | 44 |
| 45 #endif // CHROME_BROWSER_CHROMEOS_ENTERPRISE_EXTENSION_OBSERVER_H_ | 45 #endif // CHROME_BROWSER_CHROMEOS_ENTERPRISE_EXTENSION_OBSERVER_H_ |
| OLD | NEW |