Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2014 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_EXTENSIONS_SHARED_USER_SCRIPT_MASTER_H_ | |
| 6 #define CHROME_BROWSER_EXTENSIONS_SHARED_USER_SCRIPT_MASTER_H_ | |
| 7 | |
| 8 #include "base/scoped_observer.h" | |
| 9 #include "chrome/browser/extensions/user_script_master.h" | |
| 10 #include "content/public/browser/notification_observer.h" | |
| 11 #include "content/public/browser/notification_registrar.h" | |
| 12 #include "extensions/browser/extension_registry.h" | |
|
Devlin
2014/07/30 21:20:38
Can forward declare this instead.
| |
| 13 #include "extensions/browser/extension_registry_observer.h" | |
| 14 #include "extensions/common/extension.h" | |
| 15 | |
| 16 namespace content { | |
| 17 | |
| 18 class BrowserContext; | |
|
Devlin
2014/07/30 21:20:38
namespace content {
class BrowserContext;
}
| |
| 19 | |
| 20 } // namespace content | |
| 21 | |
| 22 class Profile; | |
| 23 | |
| 24 namespace extensions { | |
| 25 | |
| 26 class SharedUserScriptMaster : public UserScriptMaster, | |
|
Devlin
2014/07/30 21:20:39
add class comments
| |
| 27 public content::NotificationObserver, | |
| 28 public ExtensionRegistryObserver { | |
| 29 public: | |
| 30 explicit SharedUserScriptMaster(Profile* profile); | |
| 31 virtual ~SharedUserScriptMaster(); | |
| 32 | |
| 33 // content::NotificationObserver implementation. | |
|
Devlin
2014/07/30 21:20:39
move overloaded methods to private.
| |
| 34 virtual void Observe(int type, | |
| 35 const content::NotificationSource& source, | |
| 36 const content::NotificationDetails& details) OVERRIDE; | |
| 37 | |
| 38 // ExtensionRegistryObserver implementation. | |
| 39 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, | |
| 40 const Extension* extension) OVERRIDE; | |
| 41 virtual void OnExtensionUnloaded( | |
| 42 content::BrowserContext* browser_context, | |
| 43 const Extension* extension, | |
| 44 UnloadedExtensionInfo::Reason reason) OVERRIDE; | |
| 45 | |
| 46 virtual void StartLoad() OVERRIDE; | |
|
Devlin
2014/07/30 21:20:39
UserScriptMaster implementation.
| |
| 47 | |
| 48 private: | |
| 49 // Manages our notification registrations. | |
| 50 content::NotificationRegistrar registrar_; | |
| 51 | |
| 52 // Listen to extension load, unloaded notifications. | |
| 53 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | |
| 54 extension_registry_observer_; | |
| 55 | |
| 56 DISALLOW_COPY_AND_ASSIGN(SharedUserScriptMaster); | |
| 57 }; | |
| 58 | |
| 59 } // namespace extensions | |
| 60 | |
| 61 #endif // CHROME_BROWSER_EXTENSIONS_SHARED_USER_SCRIPT_MASTER_H_ | |
| OLD | NEW |