| 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 "base/basictypes.h" |
| 8 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 9 | 10 |
| 11 class GURL; |
| 12 |
| 10 namespace IPC { | 13 namespace IPC { |
| 11 class Message; | 14 class Message; |
| 12 } | 15 } |
| 13 | 16 |
| 14 namespace content { | 17 namespace content { |
| 15 class RenderFrameHost; | 18 class RenderFrameHost; |
| 16 class WebContents; | 19 class WebContents; |
| 17 struct ContextMenuParams; | 20 struct ContextMenuParams; |
| 18 | 21 |
| 19 // An interface implemented by an object interested in knowing about the state | 22 // An interface implemented by an object interested in knowing about the state |
| 20 // of the RenderFrameHost. | 23 // of the RenderFrameHost. |
| 21 class CONTENT_EXPORT RenderFrameHostDelegate { | 24 class CONTENT_EXPORT RenderFrameHostDelegate { |
| 22 public: | 25 public: |
| 23 // This is used to give the delegate a chance to filter IPC messages. | 26 // This is used to give the delegate a chance to filter IPC messages. |
| 24 virtual bool OnMessageReceived(RenderFrameHost* render_frame_host, | 27 virtual bool OnMessageReceived(RenderFrameHost* render_frame_host, |
| 25 const IPC::Message& message); | 28 const IPC::Message& message); |
| 26 | 29 |
| 30 // Gets the URL that is currently being displayed, if there is one. |
| 31 virtual const GURL& GetMainFrameVisibleURL() const; |
| 32 |
| 33 // A message was added to to the console. |
| 34 virtual bool AddMessageToConsole(int32 level, |
| 35 const base::string16& message, |
| 36 int32 line_no, |
| 37 const base::string16& source_id); |
| 38 |
| 27 // Informs the delegate whenever a RenderFrameHost is created. | 39 // Informs the delegate whenever a RenderFrameHost is created. |
| 28 virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) {} | 40 virtual void RenderFrameCreated(RenderFrameHost* render_frame_host) {} |
| 29 | 41 |
| 30 // Informs the delegate whenever a RenderFrameHost is deleted. | 42 // Informs the delegate whenever a RenderFrameHost is deleted. |
| 31 virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) {} | 43 virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) {} |
| 32 | 44 |
| 33 // The top-level RenderFrame began loading a new page. This corresponds to | 45 // The top-level RenderFrame began loading a new page. This corresponds to |
| 34 // Blink's notion of the throbber starting. | 46 // Blink's notion of the throbber starting. |
| 35 // |to_different_document| will be true unless the load is a fragment | 47 // |to_different_document| will be true unless the load is a fragment |
| 36 // navigation, or triggered by history.pushState/replaceState. | 48 // navigation, or triggered by history.pushState/replaceState. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 56 // not a WebContents, returns NULL. | 68 // not a WebContents, returns NULL. |
| 57 virtual WebContents* GetAsWebContents(); | 69 virtual WebContents* GetAsWebContents(); |
| 58 | 70 |
| 59 protected: | 71 protected: |
| 60 virtual ~RenderFrameHostDelegate() {} | 72 virtual ~RenderFrameHostDelegate() {} |
| 61 }; | 73 }; |
| 62 | 74 |
| 63 } // namespace content | 75 } // namespace content |
| 64 | 76 |
| 65 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_DELEGATE_H_ | 77 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_HOST_DELEGATE_H_ |
| OLD | NEW |