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