Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: content/browser/renderer_host/render_view_host_observer.cc

Issue 8676032: Move RenderViewHostObserver to content/public/browser/ and put it into the content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add render_view_host.h to DEPS file Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/renderer_host/render_view_host_observer.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #include "content/browser/renderer_host/render_view_host_observer.h"
6
7 #include "content/browser/renderer_host/render_view_host.h"
8
9 RenderViewHostObserver::RenderViewHostObserver(RenderViewHost* render_view_host)
10 : render_view_host_(render_view_host),
11 routing_id_(render_view_host->routing_id()) {
12 render_view_host_->AddObserver(this);
13 }
14
15 RenderViewHostObserver::~RenderViewHostObserver() {
16 if (render_view_host_)
17 render_view_host_->RemoveObserver(this);
18 }
19
20 void RenderViewHostObserver::RenderViewHostInitialized() {
21 }
22
23 void RenderViewHostObserver::RenderViewHostDestroyed(RenderViewHost* rvh) {
24 delete this;
25 }
26
27 void RenderViewHostObserver::Navigate(const GURL& url) {
28 }
29
30 bool RenderViewHostObserver::OnMessageReceived(const IPC::Message& message) {
31 return false;
32 }
33
34 bool RenderViewHostObserver::Send(IPC::Message* message) {
35 if (!render_view_host_) {
36 delete message;
37 return false;
38 }
39
40 return render_view_host_->Send(message);
41 }
42
43 void RenderViewHostObserver::RenderViewHostDestruction() {
44 render_view_host_->RemoveObserver(this);
45 RenderViewHost* rvh = render_view_host_;
46 render_view_host_ = NULL;
47 RenderViewHostDestroyed(rvh);
48 }
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host_observer.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698