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