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 { | 14 namespace blink { |
15 class WebFrame; | 15 class WebFrame; |
16 struct WebURLError; | |
16 } | 17 } |
17 | 18 |
18 namespace content { | 19 namespace content { |
19 | 20 |
20 class RendererPpapiHost; | 21 class RendererPpapiHost; |
21 class RenderFrame; | 22 class RenderFrame; |
22 class RenderFrameImpl; | 23 class RenderFrameImpl; |
23 | 24 |
24 // Base class for objects that want to filter incoming IPCs, and also get | 25 // Base class for objects that want to filter incoming IPCs, and also get |
25 // notified of changes to the frame. | 26 // notified of changes to the frame. |
26 class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener, | 27 class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener, |
27 public IPC::Sender { | 28 public IPC::Sender { |
28 public: | 29 public: |
29 // By default, observers will be deleted when the RenderFrame goes away. If | 30 // By default, observers will be deleted when the RenderFrame goes away. If |
30 // they want to outlive it, they can override this function. | 31 // they want to outlive it, they can override this function. |
31 virtual void OnDestruct(); | 32 virtual void OnDestruct(); |
32 | 33 |
33 // Called when a Pepper plugin is created. | 34 // Called when a Pepper plugin is created. |
34 virtual void DidCreatePepperPlugin(RendererPpapiHost* host) {} | 35 virtual void DidCreatePepperPlugin(RendererPpapiHost* host) {} |
35 | 36 |
37 // Called when a load is stopped. | |
nasko
2014/01/28 20:41:39
nit: This is explicitly stopped by the user/browse
Elly Fong-Jones
2014/01/28 21:34:20
Done.
| |
38 virtual void OnStop() {} | |
39 | |
36 // These match the Blink API notifications | 40 // These match the Blink API notifications |
37 virtual void DidCommitProvisionalLoad(bool is_new_navigation) {} | 41 virtual void DidCommitProvisionalLoad(bool is_new_navigation) {} |
42 virtual void DidStartProvisionalLoad() {} | |
43 virtual void DidFailProvisionalLoad(const blink::WebURLError& error) {} | |
44 virtual void DidFinishLoad() {} | |
45 virtual void DidAbortLoad() {} | |
nasko
2014/01/28 20:41:39
Let's get rid of DidAbortLoad, as it was never in
Elly Fong-Jones
2014/01/28 21:34:20
Done.
| |
38 | 46 |
39 // IPC::Listener implementation. | 47 // IPC::Listener implementation. |
40 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 48 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
41 | 49 |
42 // IPC::Sender implementation. | 50 // IPC::Sender implementation. |
43 virtual bool Send(IPC::Message* message) OVERRIDE; | 51 virtual bool Send(IPC::Message* message) OVERRIDE; |
44 | 52 |
45 RenderFrame* render_frame() const; | 53 RenderFrame* render_frame() const; |
46 int routing_id() const { return routing_id_; } | 54 int routing_id() const { return routing_id_; } |
47 | 55 |
(...skipping 11 matching lines...) Expand all Loading... | |
59 RenderFrame* render_frame_; | 67 RenderFrame* render_frame_; |
60 // The routing ID of the associated RenderFrame. | 68 // The routing ID of the associated RenderFrame. |
61 int routing_id_; | 69 int routing_id_; |
62 | 70 |
63 DISALLOW_COPY_AND_ASSIGN(RenderFrameObserver); | 71 DISALLOW_COPY_AND_ASSIGN(RenderFrameObserver); |
64 }; | 72 }; |
65 | 73 |
66 } // namespace content | 74 } // namespace content |
67 | 75 |
68 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ | 76 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ |
OLD | NEW |