Revert of Output closure-compiled JavaScript files (patchset #10 id:180001 of https...
[chromium-blink-merge.git] / extensions / browser / extension_host_observer.h
blobcdd26037fe235e15d42b5c1871bc55cc058a815d
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_
8 #include <string>
10 namespace extensions {
11 class ExtensionHost;
13 class ExtensionHostObserver {
14 public:
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
25 // to |host|.
26 virtual void OnBackgroundEventDispatched(const ExtensionHost* host,
27 const std::string& event_name,
28 int event_id) {}
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
36 // request.
37 virtual void OnNetworkRequestStarted(const ExtensionHost* host,
38 uint64 request_id) {}
40 // Called when the network request with |request_id| is done.
41 virtual void OnNetworkRequestDone(const ExtensionHost* host,
42 uint64 request_id) {}
45 } // namespace extensions
47 #endif /* EXTENSIONS_BROWSER_EXTENSION_HOST_OBSERVER_H_ */