Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / extensions / browser / extension_registry_observer.h
1 // Copyright 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 EXTENSIONS_BROWSER_EXTENSION_REGISTRY_OBSERVER_H_
6 #define EXTENSIONS_BROWSER_EXTENSION_REGISTRY_OBSERVER_H_
7
8 #include "extensions/common/extension.h"
9
10 namespace content {
11 class BrowserContext;
12 }
13
14 namespace extensions {
15
16 class Extension;
17 struct UnloadedExtensionInfo;
18
19 // Observer for ExtensionRegistry. Exists in a separate header file to reduce
20 // the include file burden for typical clients of ExtensionRegistry.
21 class ExtensionRegistryObserver {
22  public:
23   virtual ~ExtensionRegistryObserver() {}
24
25   // Called after an extension is loaded. The extension will exclusively exist
26   // in the enabled_extensions set of ExtensionRegistry.
27   virtual void OnExtensionLoaded(
28       content::BrowserContext* browser_context,
29       const Extension* extension) {}
30
31   // Called after an extension is unloaded. The extension no longer exists in
32   // any of the ExtensionRegistry sets (enabled, disabled, etc.).
33   virtual void OnExtensionUnloaded(content::BrowserContext* browser_context,
34                                    const Extension* extension,
35                                    UnloadedExtensionInfo::Reason reason) {}
36 };
37
38 }  // namespace extensions
39
40 #endif  // EXTENSIONS_BROWSER_EXTENSION_REGISTRY_OBSERVER_H_