This source file includes following definitions.
- routing_id_
- OnDestruct
- OnMessageReceived
- Send
- render_view
- RenderViewGone
#include "content/public/renderer/render_view_observer.h"
#include "content/renderer/render_view_impl.h"
using blink::WebFrame;
namespace content {
RenderViewObserver::RenderViewObserver(RenderView* render_view)
: render_view_(render_view),
routing_id_(MSG_ROUTING_NONE) {
if (render_view) {
RenderViewImpl* impl = static_cast<RenderViewImpl*>(render_view);
routing_id_ = impl->routing_id();
impl->AddObserver(this);
}
}
RenderViewObserver::~RenderViewObserver() {
if (render_view_) {
RenderViewImpl* impl = static_cast<RenderViewImpl*>(render_view_);
impl->RemoveObserver(this);
}
}
void RenderViewObserver::OnDestruct() {
delete this;
}
bool RenderViewObserver::OnMessageReceived(const IPC::Message& message) {
return false;
}
bool RenderViewObserver::Send(IPC::Message* message) {
if (render_view_)
return render_view_->Send(message);
delete message;
return false;
}
RenderView* RenderViewObserver::render_view() const {
return render_view_;
}
void RenderViewObserver::RenderViewGone() {
render_view_ = NULL;
}
}