linux_aura: Disable the plugin install infobar.
[chromium-blink-merge.git] / content / public / renderer / render_view_observer.cc
blob612fb150234d6ce79d81ab207e9eb65b4f199807
1 // Copyright (c) 2011 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 #include "content/public/renderer/render_view_observer.h"
7 #include "content/renderer/render_view_impl.h"
9 using blink::WebFrame;
11 namespace content {
13 RenderViewObserver::RenderViewObserver(RenderView* render_view)
14 : render_view_(render_view),
15 routing_id_(MSG_ROUTING_NONE) {
16 // |render_view| can be NULL on unit testing.
17 if (render_view) {
18 RenderViewImpl* impl = static_cast<RenderViewImpl*>(render_view);
19 routing_id_ = impl->routing_id();
20 // TODO(jam): bring this back DCHECK_NE(routing_id_, MSG_ROUTING_NONE);
21 impl->AddObserver(this);
25 RenderViewObserver::~RenderViewObserver() {
26 if (render_view_) {
27 RenderViewImpl* impl = static_cast<RenderViewImpl*>(render_view_);
28 impl->RemoveObserver(this);
32 void RenderViewObserver::OnDestruct() {
33 delete this;
36 bool RenderViewObserver::OnMessageReceived(const IPC::Message& message) {
37 return false;
40 bool RenderViewObserver::Send(IPC::Message* message) {
41 if (render_view_)
42 return render_view_->Send(message);
44 delete message;
45 return false;
48 RenderView* RenderViewObserver::render_view() const {
49 return render_view_;
52 void RenderViewObserver::RenderViewGone() {
53 render_view_ = NULL;
56 } // namespace content