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