| 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 DomOperationNotificationDetails; |
| 17 struct ContextMenuParams; | 18 struct ContextMenuParams; |
| 18 | 19 |
| 19 // An interface implemented by an object interested in knowing about the state | 20 // An interface implemented by an object interested in knowing about the state |
| 20 // of the RenderFrameHost. | 21 // of the RenderFrameHost. |
| 21 class CONTENT_EXPORT RenderFrameHostDelegate { | 22 class CONTENT_EXPORT RenderFrameHostDelegate { |
| 22 public: | 23 public: |
| 23 // This is used to give the delegate a chance to filter IPC messages. | 24 // This is used to give the delegate a chance to filter IPC messages. |
| 24 virtual bool OnMessageReceived(RenderFrameHost* render_frame_host, | 25 virtual bool OnMessageReceived(RenderFrameHost* render_frame_host, |
| 25 const IPC::Message& message); | 26 const IPC::Message& message); |
| 26 | 27 |
| 27 // Informs the delegate whenever a RenderFrameHost is created. | 28 // Informs the delegate whenever a RenderFrameHost is created. |
| 28 virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) {} | 29 virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) {} |
| 29 | 30 |
| 30 // Informs the delegate whenever a RenderFrameHost is deleted. | 31 // Informs the delegate whenever a RenderFrameHost is deleted. |
| 31 virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) {} | 32 virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) {} |
| 32 | 33 |
| 33 // Notification that a worker process has crashed. | 34 // Notification that a worker process has crashed. |
| 34 virtual void WorkerCrashed(RenderFrameHost* render_frame_host) {} | 35 virtual void WorkerCrashed(RenderFrameHost* render_frame_host) {} |
| 35 | 36 |
| 36 // A context menu should be shown, to be built using the context information | 37 // A context menu should be shown, to be built using the context information |
| 37 // provided in the supplied params. | 38 // provided in the supplied params. |
| 38 virtual void ShowContextMenu(RenderFrameHost* render_frame_host, | 39 virtual void ShowContextMenu(RenderFrameHost* render_frame_host, |
| 39 const ContextMenuParams& params) {} | 40 const ContextMenuParams& params) {} |
| 40 | 41 |
| 42 // A notification that the JavaScript running in the renderer has sent a value |
| 43 // back to the browser using the DomAutomationController. |
| 44 virtual void OnDomOperationResponse( |
| 45 const DomOperationNotificationDetails& details) {} |
| 46 |
| 41 // Return this object cast to a WebContents, if it is one. If the object is | 47 // Return this object cast to a WebContents, if it is one. If the object is |
| 42 // not a WebContents, returns NULL. | 48 // not a WebContents, returns NULL. |
| 43 virtual WebContents* GetAsWebContents(); | 49 virtual WebContents* GetAsWebContents(); |
| 44 | 50 |
| 45 protected: | 51 protected: |
| 46 virtual ~RenderFrameHostDelegate() {} | 52 virtual ~RenderFrameHostDelegate() {} |
| 47 }; | 53 }; |
| 48 | 54 |
| 49 } // namespace content | 55 } // namespace content |
| 50 | 56 |
| 51 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_DELEGATE_H_ | 57 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_DELEGATE_H_ |
| OLD | NEW |