Removed unused VideoCaptureCapability parameters.
[chromium-blink-merge.git] / content / public / renderer / render_view_observer.cc
blobc0271c11fb44c0bfd22a261fa7f7762b1b0a82a8
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 WebKit::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 impl->AddObserver(this);
24 RenderViewObserver::~RenderViewObserver() {
25 if (render_view_) {
26 RenderViewImpl* impl = static_cast<RenderViewImpl*>(render_view_);
27 impl->RemoveObserver(this);
31 void RenderViewObserver::OnDestruct() {
32 delete this;
35 bool RenderViewObserver::OnMessageReceived(const IPC::Message& message) {
36 return false;
39 bool RenderViewObserver::Send(IPC::Message* message) {
40 if (render_view_)
41 return render_view_->Send(message);
43 delete message;
44 return false;
47 RenderView* RenderViewObserver::render_view() const {
48 return render_view_;
51 void RenderViewObserver::RenderViewGone() {
52 render_view_ = NULL;
55 } // namespace content