OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_EXTENSION_WEB_UI_OVERRIDE_REGISTRAR_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_OVERRIDE_REGISTRAR_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_OVERRIDE_REGISTRAR_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_OVERRIDE_REGISTRAR_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" | 9 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" |
10 #include "content/public/browser/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
11 #include "content/public/browser/notification_registrar.h" | 11 #include "content/public/browser/notification_registrar.h" |
12 | 12 |
13 class Profile; | 13 class Profile; |
14 | 14 |
| 15 namespace content { |
| 16 class BrowserContext; |
| 17 } |
| 18 |
15 namespace extensions { | 19 namespace extensions { |
16 | 20 |
17 class ExtensionWebUIOverrideRegistrar : public ProfileKeyedAPI, | 21 class ExtensionWebUIOverrideRegistrar : public ProfileKeyedAPI, |
18 public content::NotificationObserver { | 22 public content::NotificationObserver { |
19 public: | 23 public: |
20 explicit ExtensionWebUIOverrideRegistrar(Profile* profile); | 24 explicit ExtensionWebUIOverrideRegistrar(content::BrowserContext* context); |
21 virtual ~ExtensionWebUIOverrideRegistrar(); | 25 virtual ~ExtensionWebUIOverrideRegistrar(); |
22 | 26 |
23 // ProfileKeyedAPI implementation. | 27 // ProfileKeyedAPI implementation. |
24 static ProfileKeyedAPIFactory<ExtensionWebUIOverrideRegistrar>* | 28 static ProfileKeyedAPIFactory<ExtensionWebUIOverrideRegistrar>* |
25 GetFactoryInstance(); | 29 GetFactoryInstance(); |
26 | 30 |
27 // content::NotificationObserver implementation. | 31 // content::NotificationObserver implementation. |
28 virtual void Observe(int type, | 32 virtual void Observe(int type, |
29 const content::NotificationSource& source, | 33 const content::NotificationSource& source, |
30 const content::NotificationDetails& details) OVERRIDE; | 34 const content::NotificationDetails& details) OVERRIDE; |
31 | 35 |
32 private: | 36 private: |
33 friend class ProfileKeyedAPIFactory<ExtensionWebUIOverrideRegistrar>; | 37 friend class ProfileKeyedAPIFactory<ExtensionWebUIOverrideRegistrar>; |
34 | 38 |
35 // ProfileKeyedAPI implementation. | 39 // ProfileKeyedAPI implementation. |
36 static const char* service_name() { | 40 static const char* service_name() { |
37 return "ExtensionWebUIOverrideRegistrar"; | 41 return "ExtensionWebUIOverrideRegistrar"; |
38 } | 42 } |
39 | 43 |
40 Profile* const profile_; | 44 Profile* const profile_; |
41 content::NotificationRegistrar registrar_; | 45 content::NotificationRegistrar registrar_; |
42 | 46 |
43 DISALLOW_COPY_AND_ASSIGN(ExtensionWebUIOverrideRegistrar); | 47 DISALLOW_COPY_AND_ASSIGN(ExtensionWebUIOverrideRegistrar); |
44 }; | 48 }; |
45 | 49 |
46 } // namespace extensions | 50 } // namespace extensions |
47 | 51 |
48 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_OVERRIDE_REGISTRAR_H_ | 52 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_OVERRIDE_REGISTRAR_H_ |
OLD | NEW |