| 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_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_DELEGATE_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_DELEGATE_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_DELEGATE_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
| 9 | 9 |
| 10 namespace IPC { | 10 namespace IPC { |
| 11 class Message; | 11 class Message; |
| 12 } | 12 } |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 class RenderFrameHost; | 15 class RenderFrameHost; |
| 16 class WebContents; | 16 class WebContents; |
| 17 struct ContextMenuParams; |
| 17 | 18 |
| 18 // An interface implemented by an object interested in knowing about the state | 19 // An interface implemented by an object interested in knowing about the state |
| 19 // of the RenderFrameHost. | 20 // of the RenderFrameHost. |
| 20 class CONTENT_EXPORT RenderFrameHostDelegate { | 21 class CONTENT_EXPORT RenderFrameHostDelegate { |
| 21 public: | 22 public: |
| 22 // This is used to give the delegate a chance to filter IPC messages. | 23 // This is used to give the delegate a chance to filter IPC messages. |
| 23 virtual bool OnMessageReceived(RenderFrameHost* render_frame_host, | 24 virtual bool OnMessageReceived(RenderFrameHost* render_frame_host, |
| 24 const IPC::Message& message); | 25 const IPC::Message& message); |
| 25 | 26 |
| 26 // Informs the delegate whenever a RenderFrameHost is created. | 27 // Informs the delegate whenever a RenderFrameHost is created. |
| 27 virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) {} | 28 virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) {} |
| 28 | 29 |
| 29 // Informs the delegate whenever a RenderFrameHost is deleted. | 30 // Informs the delegate whenever a RenderFrameHost is deleted. |
| 30 virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) {} | 31 virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) {} |
| 31 | 32 |
| 32 // Notification that a worker process has crashed. | 33 // Notification that a worker process has crashed. |
| 33 virtual void WorkerCrashed() {} | 34 virtual void WorkerCrashed(RenderFrameHost* render_frame_host) {} |
| 35 |
| 36 // A context menu should be shown, to be built using the context information |
| 37 // provided in the supplied params. |
| 38 virtual void ShowContextMenu(RenderFrameHost* render_frame_host, |
| 39 const ContextMenuParams& params) {} |
| 34 | 40 |
| 35 // Return this object cast to a WebContents, if it is one. If the object is | 41 // Return this object cast to a WebContents, if it is one. If the object is |
| 36 // not a WebContents, returns NULL. | 42 // not a WebContents, returns NULL. |
| 37 virtual WebContents* GetAsWebContents(); | 43 virtual WebContents* GetAsWebContents(); |
| 38 | 44 |
| 39 protected: | 45 protected: |
| 40 virtual ~RenderFrameHostDelegate() {} | 46 virtual ~RenderFrameHostDelegate() {} |
| 41 }; | 47 }; |
| 42 | 48 |
| 43 } // namespace content | 49 } // namespace content |
| 44 | 50 |
| 45 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_DELEGATE_H_ | 51 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_DELEGATE_H_ |
| OLD | NEW |