1 // Copyright 2015 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.
5 #ifndef EXTENSIONS_BROWSER_EXTENSION_HOST_OBSERVER_H_
6 #define EXTENSIONS_BROWSER_EXTENSION_HOST_OBSERVER_H_
10 namespace extensions
{
13 class ExtensionHostObserver
{
15 virtual ~ExtensionHostObserver() {}
17 // TODO(kalman): Why do these all return const ExtensionHosts? It seems
18 // perfectly reasonable for an Observer implementation to mutate any
19 // ExtensionHost it's given.
21 // Called when an ExtensionHost is destroyed.
22 virtual void OnExtensionHostDestroyed(const ExtensionHost
* host
) {}
24 // Called when a message has been disptached to the event page corresponding
26 virtual void OnBackgroundEventDispatched(const ExtensionHost
* host
,
27 const std::string
& event_name
,
30 // Called when a previously dispatched message has been acked by the
31 // event page for |host|.
32 virtual void OnBackgroundEventAcked(const ExtensionHost
* host
, int event_id
) {
35 // Called when the extension associated with |host| starts a new network
37 virtual void OnNetworkRequestStarted(const ExtensionHost
* host
,
40 // Called when the network request with |request_id| is done.
41 virtual void OnNetworkRequestDone(const ExtensionHost
* host
,
45 } // namespace extensions
47 #endif /* EXTENSIONS_BROWSER_EXTENSION_HOST_OBSERVER_H_ */