OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_OBSERVER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_VIEW_HOST_OBSERVER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_OBSERVER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_RENDER_VIEW_HOST_OBSERVER_H_ |
| 7 #pragma once |
7 | 8 |
8 #include "ipc/ipc_channel.h" | 9 #include "ipc/ipc_channel.h" |
9 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
10 | 11 |
11 class GURL; | 12 class GURL; |
12 class RenderViewHost; | 13 class RenderViewHost; |
13 | 14 |
| 15 namespace content { |
| 16 |
14 // An observer API implemented by classes which want to filter IPC messages from | 17 // An observer API implemented by classes which want to filter IPC messages from |
15 // RenderViewHost. | 18 // RenderViewHost. |
16 class CONTENT_EXPORT RenderViewHostObserver : public IPC::Channel::Listener, | 19 class CONTENT_EXPORT RenderViewHostObserver : public IPC::Channel::Listener, |
17 public IPC::Message::Sender { | 20 public IPC::Message::Sender { |
18 public: | 21 public: |
19 | 22 |
20 protected: | 23 protected: |
21 explicit RenderViewHostObserver(RenderViewHost* render_view_host); | 24 explicit RenderViewHostObserver(RenderViewHost* render_view_host); |
22 | 25 |
23 virtual ~RenderViewHostObserver(); | 26 virtual ~RenderViewHostObserver(); |
(...skipping 14 matching lines...) Expand all Loading... |
38 // IPC::Channel::Listener implementation. | 41 // IPC::Channel::Listener implementation. |
39 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 42 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
40 | 43 |
41 // IPC::Message::Sender implementation. | 44 // IPC::Message::Sender implementation. |
42 virtual bool Send(IPC::Message* message) OVERRIDE; | 45 virtual bool Send(IPC::Message* message) OVERRIDE; |
43 | 46 |
44 RenderViewHost* render_view_host() const { return render_view_host_; } | 47 RenderViewHost* render_view_host() const { return render_view_host_; } |
45 int routing_id() { return routing_id_; } | 48 int routing_id() { return routing_id_; } |
46 | 49 |
47 private: | 50 private: |
48 friend class RenderViewHost; | 51 friend class ::RenderViewHost; |
49 | 52 |
50 // Invoked from RenderViewHost. Invokes RenderViewHostDestroyed and NULL out | 53 // Invoked from RenderViewHost. Invokes RenderViewHostDestroyed and NULL out |
51 // |render_view_host_|. | 54 // |render_view_host_|. |
52 void RenderViewHostDestruction(); | 55 void RenderViewHostDestruction(); |
53 | 56 |
54 RenderViewHost* render_view_host_; | 57 RenderViewHost* render_view_host_; |
55 | 58 |
56 // The routing ID of the associated RenderViewHost. | 59 // The routing ID of the associated RenderViewHost. |
57 int routing_id_; | 60 int routing_id_; |
58 | 61 |
59 DISALLOW_COPY_AND_ASSIGN(RenderViewHostObserver); | 62 DISALLOW_COPY_AND_ASSIGN(RenderViewHostObserver); |
60 }; | 63 }; |
61 | 64 |
62 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_OBSERVER_H_ | 65 } // namespace content |
| 66 |
| 67 #endif // CONTENT_PUBLIC_BROWSER_RENDER_VIEW_HOST_OBSERVER_H_ |
OLD | NEW |