Chromium Code Reviews| 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 class 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 |
| 36 // These match the Blink API notifications | 37 // These match the Blink API notifications |
| 37 virtual void DidCommitProvisionalLoad(blink::WebFrame* frame, | 38 virtual void DidCommitProvisionalLoad(bool is_new_navigation) {} |
| 38 bool is_new_navigation) {} | 39 virtual void DidStartProvisionalLoad() { } |
|
jam
2014/01/22 03:15:35
nit: no space inside brackets, also below
| |
| 40 virtual void DidFailProvisionalLoad(const blink::WebURLError& error) { } | |
| 41 virtual void DidFinishLoad() { } | |
| 39 | 42 |
| 40 // IPC::Listener implementation. | 43 // IPC::Listener implementation. |
| 41 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 44 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 42 | 45 |
| 43 // IPC::Sender implementation. | 46 // IPC::Sender implementation. |
| 44 virtual bool Send(IPC::Message* message) OVERRIDE; | 47 virtual bool Send(IPC::Message* message) OVERRIDE; |
| 45 | 48 |
| 46 RenderFrame* render_frame() const; | 49 RenderFrame* render_frame() const; |
| 47 int routing_id() const { return routing_id_; } | 50 int routing_id() const { return routing_id_; } |
| 48 | 51 |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 60 RenderFrame* render_frame_; | 63 RenderFrame* render_frame_; |
| 61 // The routing ID of the associated RenderFrame. | 64 // The routing ID of the associated RenderFrame. |
| 62 int routing_id_; | 65 int routing_id_; |
| 63 | 66 |
| 64 DISALLOW_COPY_AND_ASSIGN(RenderFrameObserver); | 67 DISALLOW_COPY_AND_ASSIGN(RenderFrameObserver); |
| 65 }; | 68 }; |
| 66 | 69 |
| 67 } // namespace content | 70 } // namespace content |
| 68 | 71 |
| 69 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ | 72 #endif // CONTENT_PUBLIC_RENDERER_RENDER_FRAME_OBSERVER_H_ |
| OLD | NEW |