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_BROWSER_RENDER_FRAME_HOST_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_ | 6 #define CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_ |
| 7 | 7 |
| 8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
| 9 #include "ipc/ipc_listener.h" | 9 #include "ipc/ipc_listener.h" |
| 10 #include "ipc/ipc_sender.h" | 10 #include "ipc/ipc_sender.h" |
| 11 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
| 12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 class RenderProcessHost; | 15 class RenderProcessHost; |
| 16 class RenderViewHost; | 16 class RenderViewHost; |
| 17 class SiteInstance; | 17 class SiteInstance; |
| 18 struct CustomContextMenuContext; | 18 struct CustomContextMenuContext; |
| 19 | 19 |
| 20 // The interface provides a communication conduit with a frame in the renderer. | 20 // The interface provides a communication conduit with a frame in the renderer. |
| 21 class CONTENT_EXPORT RenderFrameHost : public IPC::Listener, | 21 class CONTENT_EXPORT RenderFrameHost : public IPC::Listener, |
| 22 public IPC::Sender { | 22 public IPC::Sender { |
| 23 public: | 23 public: |
| 24 // Returns the RenderFrameHost given its ID and the ID of its render process. | 24 // Returns the RenderFrameHost given its ID and the ID of its render process. |
| 25 // Returns NULL if the IDs do not correspond to a live RenderFrameHost. | 25 // Returns NULL if the IDs do not correspond to a live RenderFrameHost. |
| 26 static RenderFrameHost* FromID(int render_process_id, int render_frame_id); | 26 static RenderFrameHost* FromID(int render_process_id, int render_frame_id); |
| 27 | 27 |
| 28 virtual ~RenderFrameHost() {} | 28 virtual ~RenderFrameHost() {} |
| 29 | 29 |
| 30 virtual SiteInstance* GetSiteInstance() = 0; | 30 // Returns the route id for this frame. |
| 31 virtual int GetRoutingID() const = 0; | |
|
jam
2014/03/01 01:21:08
nit: here and in the rest of the file, i have avoi
Charlie Reis
2014/03/01 01:39:05
Ah, fair point. I'll remove that.
Charlie Reis
2014/03/03 07:14:50
Done.
| |
| 32 | |
| 33 // Returns the SiteInstance grouping all RenderFrameHosts that have script | |
| 34 // access to this RenderFrameHost, and must therefore live in the same | |
| 35 // process. | |
| 36 virtual SiteInstance* GetSiteInstance() const = 0; | |
| 37 | |
| 38 // Returns a bitwise OR of bindings types that have been enabled for this | |
| 39 // RenderFrameHost's RenderView. See BindingsPolicy for details. | |
| 40 virtual int GetEnabledBindings() const = 0; | |
|
jam
2014/03/01 01:21:08
two questions:
right now this is only called insid
Charlie Reis
2014/03/01 01:39:05
Sure, I can change it in the next patch.
Charlie Reis
2014/03/03 07:14:50
Done.
jam
2014/03/03 16:08:04
ah, makes senses! ignore that then :)
| |
| 31 | 41 |
| 32 // Returns the process for this frame. | 42 // Returns the process for this frame. |
| 33 virtual RenderProcessHost* GetProcess() = 0; | 43 virtual RenderProcessHost* GetProcess() const = 0; |
| 34 | |
| 35 // Returns the route id for this frame. | |
| 36 virtual int GetRoutingID() = 0; | |
| 37 | 44 |
| 38 // Returns the current RenderFrameHost of the parent frame, or NULL if there | 45 // Returns the current RenderFrameHost of the parent frame, or NULL if there |
| 39 // is no parent. The result may be in a different process than the current | 46 // is no parent. The result may be in a different process than the current |
| 40 // RenderFrameHost. | 47 // RenderFrameHost. |
| 41 virtual RenderFrameHost* GetParent() = 0; | 48 virtual RenderFrameHost* GetParent() const = 0; |
| 42 | 49 |
| 43 // Returns true if the frame is out of process. | 50 // Returns true if the frame is out of process. |
| 44 virtual bool IsCrossProcessSubframe() = 0; | 51 virtual bool IsCrossProcessSubframe() const = 0; |
| 45 | 52 |
| 46 // Returns the last committed URL of the frame. | 53 // Returns the last committed URL of the frame. |
| 47 virtual GURL GetLastCommittedURL() = 0; | 54 virtual GURL GetLastCommittedURL() const = 0; |
| 48 | 55 |
| 49 // Returns the associated widget's native view. | 56 // Returns the associated widget's native view. |
| 50 virtual gfx::NativeView GetNativeView() = 0; | 57 virtual gfx::NativeView GetNativeView() const = 0; |
| 51 | 58 |
| 52 // Let the renderer know that the menu has been closed. | 59 // Let the renderer know that the menu has been closed. |
| 53 virtual void NotifyContextMenuClosed( | 60 virtual void NotifyContextMenuClosed( |
| 54 const CustomContextMenuContext& context) = 0; | 61 const CustomContextMenuContext& context) = 0; |
| 55 | 62 |
| 56 // Executes custom context menu action that was provided from Blink. | 63 // Executes custom context menu action that was provided from Blink. |
| 57 virtual void ExecuteCustomContextMenuCommand( | 64 virtual void ExecuteCustomContextMenuCommand( |
| 58 int action, const CustomContextMenuContext& context) = 0; | 65 int action, const CustomContextMenuContext& context) = 0; |
| 59 | 66 |
| 60 // Temporary until we get rid of RenderViewHost. | 67 // Temporary until we get rid of RenderViewHost. |
| 61 virtual RenderViewHost* GetRenderViewHost() = 0; | 68 virtual RenderViewHost* GetRenderViewHost() const = 0; |
| 62 | 69 |
| 63 private: | 70 private: |
| 64 // This interface should only be implemented inside content. | 71 // This interface should only be implemented inside content. |
| 65 friend class RenderFrameHostImpl; | 72 friend class RenderFrameHostImpl; |
| 66 RenderFrameHost() {} | 73 RenderFrameHost() {} |
| 67 }; | 74 }; |
| 68 | 75 |
| 69 } // namespace content | 76 } // namespace content |
| 70 | 77 |
| 71 #endif // CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_ | 78 #endif // CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_ |
| OLD | NEW |