Chromium Code Reviews| Index: chrome/browser/extensions/shared_user_script_master.h |
| diff --git a/chrome/browser/extensions/shared_user_script_master.h b/chrome/browser/extensions/shared_user_script_master.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c0a3067fe50c331761832c3a7142a9caa3cb2dc0 |
| --- /dev/null |
| +++ b/chrome/browser/extensions/shared_user_script_master.h |
| @@ -0,0 +1,61 @@ |
| +// Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_EXTENSIONS_SHARED_USER_SCRIPT_MASTER_H_ |
| +#define CHROME_BROWSER_EXTENSIONS_SHARED_USER_SCRIPT_MASTER_H_ |
| + |
| +#include "base/scoped_observer.h" |
| +#include "chrome/browser/extensions/user_script_master.h" |
| +#include "content/public/browser/notification_observer.h" |
| +#include "content/public/browser/notification_registrar.h" |
| +#include "extensions/browser/extension_registry.h" |
|
Devlin
2014/07/30 21:20:38
Can forward declare this instead.
|
| +#include "extensions/browser/extension_registry_observer.h" |
| +#include "extensions/common/extension.h" |
| + |
| +namespace content { |
| + |
| +class BrowserContext; |
|
Devlin
2014/07/30 21:20:38
namespace content {
class BrowserContext;
}
|
| + |
| +} // namespace content |
| + |
| +class Profile; |
| + |
| +namespace extensions { |
| + |
| +class SharedUserScriptMaster : public UserScriptMaster, |
|
Devlin
2014/07/30 21:20:39
add class comments
|
| + public content::NotificationObserver, |
| + public ExtensionRegistryObserver { |
| + public: |
| + explicit SharedUserScriptMaster(Profile* profile); |
| + virtual ~SharedUserScriptMaster(); |
| + |
| + // content::NotificationObserver implementation. |
|
Devlin
2014/07/30 21:20:39
move overloaded methods to private.
|
| + virtual void Observe(int type, |
| + const content::NotificationSource& source, |
| + const content::NotificationDetails& details) OVERRIDE; |
| + |
| + // ExtensionRegistryObserver implementation. |
| + virtual void OnExtensionLoaded(content::BrowserContext* browser_context, |
| + const Extension* extension) OVERRIDE; |
| + virtual void OnExtensionUnloaded( |
| + content::BrowserContext* browser_context, |
| + const Extension* extension, |
| + UnloadedExtensionInfo::Reason reason) OVERRIDE; |
| + |
| + virtual void StartLoad() OVERRIDE; |
|
Devlin
2014/07/30 21:20:39
UserScriptMaster implementation.
|
| + |
| + private: |
| + // Manages our notification registrations. |
| + content::NotificationRegistrar registrar_; |
| + |
| + // Listen to extension load, unloaded notifications. |
| + ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
| + extension_registry_observer_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(SharedUserScriptMaster); |
| +}; |
| + |
| +} // namespace extensions |
| + |
| +#endif // CHROME_BROWSER_EXTENSIONS_SHARED_USER_SCRIPT_MASTER_H_ |