#ifndef CONTENT_RENDERER_MOJO_MOJO_RENDER_PROCESS_OBSERVER_H_
#define CONTENT_RENDERER_MOJO_MOJO_RENDER_PROCESS_OBSERVER_H_
#include "base/memory/scoped_ptr.h"
#include "content/common/mojo/render_process.mojom.h"
#include "content/public/renderer/render_process_observer.h"
#include "ipc/ipc_platform_file.h"
#include "mojo/public/cpp/bindings/remote_ptr.h"
namespace mojo {
namespace embedder{
struct ChannelInfo;
}
}
namespace content {
class MojoChannelInit;
class RenderThread;
class MojoRenderProcessObserver
: public content::RenderProcessObserver,
public RenderProcessMojo {
public:
MojoRenderProcessObserver(RenderThread* render_thread);
virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
virtual void OnRenderProcessShutdown() OVERRIDE;
private:
virtual ~MojoRenderProcessObserver();
void OnChannelCreated(const IPC::PlatformFileForTransit& file);
virtual void SetWebUIHandle(
int32 view_routing_id,
mojo::ScopedMessagePipeHandle web_ui_handle) OVERRIDE;
content::RenderThread* render_thread_;
scoped_ptr<MojoChannelInit> channel_init_;
mojo::RemotePtr<content::RenderProcessHostMojo> render_process_host_mojo_;
DISALLOW_COPY_AND_ASSIGN(MojoRenderProcessObserver);
};
}
#endif