| Index: extensions/browser/extension_host.h
|
| diff --git a/extensions/browser/extension_host.h b/extensions/browser/extension_host.h
|
| index 4f815011c2b57a4471e177c292d250f6ca715eda..53e2f243fe0977a598a278fa751f8c9812eec926 100644
|
| --- a/extensions/browser/extension_host.h
|
| +++ b/extensions/browser/extension_host.h
|
| @@ -10,6 +10,7 @@
|
|
|
| #include "base/logging.h"
|
| #include "base/memory/scoped_ptr.h"
|
| +#include "base/observer_list.h"
|
| #include "base/timer/elapsed_timer.h"
|
| #include "content/public/browser/notification_observer.h"
|
| #include "content/public/browser/notification_registrar.h"
|
| @@ -31,6 +32,7 @@ class SiteInstance;
|
| namespace extensions {
|
| class Extension;
|
| class ExtensionHostDelegate;
|
| +class ExtensionHostObserver;
|
| class WindowController;
|
|
|
| // This class is the browser component of an extension component's RenderView.
|
| @@ -75,6 +77,22 @@ class ExtensionHost : public content::WebContentsDelegate,
|
| // (can be NULL). This happens delayed to avoid locking the UI.
|
| void CreateRenderViewSoon();
|
|
|
| + // Typical observer interface.
|
| + void AddObserver(ExtensionHostObserver* observer);
|
| + void RemoveObserver(ExtensionHostObserver* observer);
|
| +
|
| + // Called when an IPC message is dispatched to the RenderView associated with
|
| + // this ExtensionHost.
|
| + void OnMessageDispatched(const std::string& event_name, int message_id);
|
| +
|
| + // Called by the ProcessManager when a network request is started by the
|
| + // extension corresponding to this ExtensionHost.
|
| + void OnNetworkRequestStarted(uint64 request_id);
|
| +
|
| + // Called by the ProcessManager when a previously started network request is
|
| + // finished.
|
| + void OnNetworkRequestDone(uint64 request_id);
|
| +
|
| // content::WebContentsObserver
|
| bool OnMessageReceived(const IPC::Message& message) override;
|
| void RenderViewCreated(content::RenderViewHost* render_view_host) override;
|
| @@ -135,7 +153,7 @@ class ExtensionHost : public content::WebContentsDelegate,
|
|
|
| // Message handlers.
|
| void OnRequest(const ExtensionHostMsg_Request_Params& params);
|
| - void OnEventAck();
|
| + void OnEventAck(int message_id);
|
| void OnIncrementLazyKeepaliveCount();
|
| void OnDecrementLazyKeepaliveCount();
|
|
|
| @@ -178,6 +196,8 @@ class ExtensionHost : public content::WebContentsDelegate,
|
| // Used to measure how long it's been since the host was created.
|
| base::ElapsedTimer since_created_;
|
|
|
| + ObserverList<ExtensionHostObserver> observer_list_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(ExtensionHost);
|
| };
|
|
|
|
|