| 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 explicitly stopped by the user or browser. |
| 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() {} |
| 38 | 45 |
| 39 // IPC::Listener implementation. | 46 // IPC::Listener implementation. |
| 40 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 47 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 41 | 48 |
| 42 // IPC::Sender implementation. | 49 // IPC::Sender implementation. |
| 43 virtual bool Send(IPC::Message* message) OVERRIDE; | 50 virtual bool Send(IPC::Message* message) OVERRIDE; |
| 44 | 51 |
| 45 RenderFrame* render_frame() const; | 52 RenderFrame* render_frame() const; |
| 46 int routing_id() const { return routing_id_; } | 53 int routing_id() const { return routing_id_; } |
| 47 | 54 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 59 RenderFrame* render_frame_; | 66 RenderFrame* render_frame_; |
| 60 // The routing ID of the associated RenderFrame. | 67 // The routing ID of the associated RenderFrame. |
| 61 int routing_id_; | 68 int routing_id_; |
| 62 | 69 |
| 63 DISALLOW_COPY_AND_ASSIGN(RenderFrameObserver); | 70 DISALLOW_COPY_AND_ASSIGN(RenderFrameObserver); |
| 64 }; | 71 }; |
| 65 | 72 |
| 66 } // namespace content | 73 } // namespace content |
| 67 | 74 |
| 68 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ | 75 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ |
| OLD | NEW |