| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_VIEW_HOST_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_VIEW_HOST_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_RENDER_VIEW_HOST_H_ | 6 #define CONTENT_PUBLIC_BROWSER_RENDER_VIEW_HOST_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 } | 35 } |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 struct WebMediaPlayerAction; | 38 struct WebMediaPlayerAction; |
| 39 struct WebPluginAction; | 39 struct WebPluginAction; |
| 40 } | 40 } |
| 41 | 41 |
| 42 namespace content { | 42 namespace content { |
| 43 | 43 |
| 44 class ChildProcessSecurityPolicy; | 44 class ChildProcessSecurityPolicy; |
| 45 class RenderFrameHost; |
| 45 class RenderViewHostDelegate; | 46 class RenderViewHostDelegate; |
| 46 class SessionStorageNamespace; | 47 class SessionStorageNamespace; |
| 47 class SiteInstance; | 48 class SiteInstance; |
| 48 struct CustomContextMenuContext; | 49 struct CustomContextMenuContext; |
| 49 struct DropData; | 50 struct DropData; |
| 50 | 51 |
| 51 // A RenderViewHost is responsible for creating and talking to a RenderView | 52 // A RenderViewHost is responsible for creating and talking to a RenderView |
| 52 // object in a child process. It exposes a high level API to users, for things | 53 // object in a child process. It exposes a high level API to users, for things |
| 53 // like loading pages, adjusting the display and other browser functionality, | 54 // like loading pages, adjusting the display and other browser functionality, |
| 54 // which it translates into IPC messages sent over the IPC channel with the | 55 // which it translates into IPC messages sent over the IPC channel with the |
| 55 // RenderView. It responds to all IPC messages sent by that RenderView and | 56 // RenderView. It responds to all IPC messages sent by that RenderView and |
| 56 // cracks them, calling a delegate object back with higher level types where | 57 // cracks them, calling a delegate object back with higher level types where |
| 57 // possible. | 58 // possible. |
| 58 // | 59 // |
| 59 // The intent of this interface is to provide a view-agnostic communication | 60 // The intent of this interface is to provide a view-agnostic communication |
| 60 // conduit with a renderer. This is so we can build HTML views not only as | 61 // conduit with a renderer. This is so we can build HTML views not only as |
| 61 // WebContents (see WebContents for an example) but also as views, etc. | 62 // WebContents (see WebContents for an example) but also as views, etc. |
| 62 class CONTENT_EXPORT RenderViewHost : virtual public RenderWidgetHost { | 63 class CONTENT_EXPORT RenderViewHost : virtual public RenderWidgetHost { |
| 63 public: | 64 public: |
| 64 // Returns the RenderViewHost given its ID and the ID of its render process. | 65 // Returns the RenderViewHost given its ID and the ID of its render process. |
| 65 // Returns NULL if the IDs do not correspond to a live RenderViewHost. | 66 // Returns NULL if the IDs do not correspond to a live RenderViewHost. |
| 66 static RenderViewHost* FromID(int render_process_id, int render_view_id); | 67 static RenderViewHost* FromID(int render_process_id, int render_view_id); |
| 67 | 68 |
| 68 // Downcasts from a RenderWidgetHost to a RenderViewHost. Required | 69 // Downcasts from a RenderWidgetHost to a RenderViewHost. Required |
| 69 // because RenderWidgetHost is a virtual base class. | 70 // because RenderWidgetHost is a virtual base class. |
| 70 static RenderViewHost* From(RenderWidgetHost* rwh); | 71 static RenderViewHost* From(RenderWidgetHost* rwh); |
| 71 | 72 |
| 72 virtual ~RenderViewHost() {} | 73 virtual ~RenderViewHost() {} |
| 73 | 74 |
| 75 // Returns the main frame for this render view. |
| 76 virtual RenderFrameHost* GetMainFrame() = 0; |
| 77 |
| 74 // Tell the render view to enable a set of javascript bindings. The argument | 78 // Tell the render view to enable a set of javascript bindings. The argument |
| 75 // should be a combination of values from BindingsPolicy. | 79 // should be a combination of values from BindingsPolicy. |
| 76 virtual void AllowBindings(int binding_flags) = 0; | 80 virtual void AllowBindings(int binding_flags) = 0; |
| 77 | 81 |
| 78 // Tells the renderer to clear the focused node (if any). | 82 // Tells the renderer to clear the focused node (if any). |
| 79 virtual void ClearFocusedNode() = 0; | 83 virtual void ClearFocusedNode() = 0; |
| 80 | 84 |
| 81 // Causes the renderer to close the current page, including running its | 85 // Causes the renderer to close the current page, including running its |
| 82 // onunload event handler. A ClosePage_ACK message will be sent to the | 86 // onunload event handler. A ClosePage_ACK message will be sent to the |
| 83 // ResourceDispatcherHost when it is finished. | 87 // ResourceDispatcherHost when it is finished. |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 | 274 |
| 271 private: | 275 private: |
| 272 // This interface should only be implemented inside content. | 276 // This interface should only be implemented inside content. |
| 273 friend class RenderViewHostImpl; | 277 friend class RenderViewHostImpl; |
| 274 RenderViewHost() {} | 278 RenderViewHost() {} |
| 275 }; | 279 }; |
| 276 | 280 |
| 277 } // namespace content | 281 } // namespace content |
| 278 | 282 |
| 279 #endif // CONTENT_PUBLIC_BROWSER_RENDER_VIEW_HOST_H_ | 283 #endif // CONTENT_PUBLIC_BROWSER_RENDER_VIEW_HOST_H_ |
| OLD | NEW |