OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_RENDERER_RENDER_FRAME_OBSERVER_H_ | 5 #ifndef CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ |
6 #define CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ | 6 #define CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 #include "ipc/ipc_listener.h" | 11 #include "ipc/ipc_listener.h" |
12 #include "ipc/ipc_sender.h" | 12 #include "ipc/ipc_sender.h" |
13 | 13 |
| 14 namespace blink { |
| 15 class WebFrame; |
| 16 } |
| 17 |
14 namespace content { | 18 namespace content { |
15 | 19 |
16 class RendererPpapiHost; | 20 class RendererPpapiHost; |
17 class RenderFrame; | 21 class RenderFrame; |
18 class RenderFrameImpl; | 22 class RenderFrameImpl; |
19 | 23 |
20 // Base class for objects that want to filter incoming IPCs, and also get | 24 // Base class for objects that want to filter incoming IPCs, and also get |
21 // notified of changes to the frame. | 25 // notified of changes to the frame. |
22 class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener, | 26 class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener, |
23 public IPC::Sender { | 27 public IPC::Sender { |
24 public: | 28 public: |
25 // By default, observers will be deleted when the RenderFrame goes away. If | 29 // By default, observers will be deleted when the RenderFrame goes away. If |
26 // they want to outlive it, they can override this function. | 30 // they want to outlive it, they can override this function. |
27 virtual void OnDestruct(); | 31 virtual void OnDestruct(); |
28 | 32 |
29 // Called when a Pepper plugin is created. | 33 // Called when a Pepper plugin is created. |
30 virtual void DidCreatePepperPlugin(RendererPpapiHost* host) {} | 34 virtual void DidCreatePepperPlugin(RendererPpapiHost* host) {} |
31 | 35 |
| 36 // Called when the WebFrame associated with the RenderFrame is created. |
| 37 // When switches::kSitePerProcess is the default, there will be one |
| 38 // RenderFrame per blink::WebFrame. If it's not set though, a RenderFrame can |
| 39 // be used for more than one blink::WebFrame. In that case, this can be called |
| 40 // more than once. |
| 41 virtual void WebFrameCreated(blink::WebFrame* frame) {} |
| 42 |
| 43 // These match the Blink API notifications |
| 44 virtual void DidCommitProvisionalLoad(blink::WebFrame* frame, |
| 45 bool is_new_navigation) {} |
| 46 |
32 // IPC::Listener implementation. | 47 // IPC::Listener implementation. |
33 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 48 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
34 | 49 |
35 // IPC::Sender implementation. | 50 // IPC::Sender implementation. |
36 virtual bool Send(IPC::Message* message) OVERRIDE; | 51 virtual bool Send(IPC::Message* message) OVERRIDE; |
37 | 52 |
38 RenderFrame* render_frame() const; | 53 RenderFrame* render_frame() const; |
39 int routing_id() const { return routing_id_; } | 54 int routing_id() const { return routing_id_; } |
40 | 55 |
41 protected: | 56 protected: |
(...skipping 10 matching lines...) Expand all Loading... |
52 RenderFrame* render_frame_; | 67 RenderFrame* render_frame_; |
53 // The routing ID of the associated RenderFrame. | 68 // The routing ID of the associated RenderFrame. |
54 int routing_id_; | 69 int routing_id_; |
55 | 70 |
56 DISALLOW_COPY_AND_ASSIGN(RenderFrameObserver); | 71 DISALLOW_COPY_AND_ASSIGN(RenderFrameObserver); |
57 }; | 72 }; |
58 | 73 |
59 } // namespace content | 74 } // namespace content |
60 | 75 |
61 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ | 76 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ |
OLD | NEW |