Chromium Code Reviews| 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 "base/values.h" | 8 #include "base/values.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 #include "content/public/browser/render_widget_host.h" | 10 #include "content/public/browser/render_widget_host.h" |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 | 30 |
| 31 namespace WebKit { | 31 namespace WebKit { |
| 32 struct WebFindOptions; | 32 struct WebFindOptions; |
| 33 struct WebMediaPlayerAction; | 33 struct WebMediaPlayerAction; |
| 34 struct WebPluginAction; | 34 struct WebPluginAction; |
| 35 } | 35 } |
| 36 | 36 |
| 37 namespace content { | 37 namespace content { |
| 38 | 38 |
| 39 class ChildProcessSecurityPolicy; | 39 class ChildProcessSecurityPolicy; |
| 40 class RenderViewHostDelegate; | 40 class RenderViewHostDelegate; |
|
joth
2012/10/29 19:36:46
nit: may as well add RenderProcessHost here. I thi
Charlie Reis
2012/10/29 19:41:42
Done.
| |
| 41 class SessionStorageNamespace; | 41 class SessionStorageNamespace; |
| 42 class SiteInstance; | 42 class SiteInstance; |
| 43 struct CustomContextMenuContext; | 43 struct CustomContextMenuContext; |
| 44 | 44 |
| 45 // A RenderViewHost is responsible for creating and talking to a RenderView | 45 // A RenderViewHost is responsible for creating and talking to a RenderView |
| 46 // object in a child process. It exposes a high level API to users, for things | 46 // object in a child process. It exposes a high level API to users, for things |
| 47 // like loading pages, adjusting the display and other browser functionality, | 47 // like loading pages, adjusting the display and other browser functionality, |
| 48 // which it translates into IPC messages sent over the IPC channel with the | 48 // which it translates into IPC messages sent over the IPC channel with the |
| 49 // RenderView. It responds to all IPC messages sent by that RenderView and | 49 // RenderView. It responds to all IPC messages sent by that RenderView and |
| 50 // cracks them, calling a delegate object back with higher level types where | 50 // cracks them, calling a delegate object back with higher level types where |
| 51 // possible. | 51 // possible. |
| 52 // | 52 // |
| 53 // The intent of this interface is to provide a view-agnostic communication | 53 // The intent of this interface is to provide a view-agnostic communication |
| 54 // conduit with a renderer. This is so we can build HTML views not only as | 54 // conduit with a renderer. This is so we can build HTML views not only as |
| 55 // WebContents (see WebContents for an example) but also as views, etc. | 55 // WebContents (see WebContents for an example) but also as views, etc. |
| 56 class CONTENT_EXPORT RenderViewHost : virtual public RenderWidgetHost { | 56 class CONTENT_EXPORT RenderViewHost : virtual public RenderWidgetHost { |
| 57 public: | 57 public: |
| 58 // Returns the RenderViewHost given its ID and the ID of its render process. | 58 // Returns the RenderViewHost given its ID and the ID of its render process. |
| 59 // Returns NULL if the IDs do not correspond to a live RenderViewHost. | 59 // Returns NULL if the IDs do not correspond to a live RenderViewHost. |
| 60 static RenderViewHost* FromID(int render_process_id, int render_view_id); | 60 static RenderViewHost* FromID(int render_process_id, int render_view_id); |
| 61 | 61 |
| 62 // Downcasts from a RenderWidgetHost to a RenderViewHost. Required | 62 // Downcasts from a RenderWidgetHost to a RenderViewHost. Required |
| 63 // because RenderWidgetHost is a virtual base class. | 63 // because RenderWidgetHost is a virtual base class. |
| 64 static RenderViewHost* From(RenderWidgetHost* rwh); | 64 static RenderViewHost* From(RenderWidgetHost* rwh); |
| 65 | 65 |
| 66 // Checks that the given renderer can request |url|, if not it sets it to | 66 // Checks that the given renderer can request |url|, if not it sets it to |
| 67 // about:blank. | 67 // about:blank. |
| 68 // |empty_allowed| must be set to false for navigations for security reasons. | 68 // |empty_allowed| must be set to false for navigations for security reasons. |
| 69 static void FilterURL(int renderer_id, | 69 static void FilterURL(const RenderProcessHost* process, |
| 70 bool empty_allowed, | 70 bool empty_allowed, |
| 71 GURL* url); | 71 GURL* url); |
| 72 | 72 |
| 73 virtual ~RenderViewHost() {} | 73 virtual ~RenderViewHost() {} |
| 74 | 74 |
| 75 // Tell the render view to enable a set of javascript bindings. The argument | 75 // Tell the render view to enable a set of javascript bindings. The argument |
| 76 // should be a combination of values from BindingsPolicy. | 76 // should be a combination of values from BindingsPolicy. |
| 77 virtual void AllowBindings(int binding_flags) = 0; | 77 virtual void AllowBindings(int binding_flags) = 0; |
| 78 | 78 |
| 79 // Tells the renderer to clear the focused node (if any). | 79 // Tells the renderer to clear the focused node (if any). |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 284 const WebKit::WebFindOptions& options, | 284 const WebKit::WebFindOptions& options, |
| 285 int* match_count, | 285 int* match_count, |
| 286 int* active_ordinal) = 0; | 286 int* active_ordinal) = 0; |
| 287 #endif | 287 #endif |
| 288 | 288 |
| 289 }; | 289 }; |
| 290 | 290 |
| 291 } // namespace content | 291 } // namespace content |
| 292 | 292 |
| 293 #endif // CONTENT_PUBLIC_BROWSER_RENDER_VIEW_HOST_H_ | 293 #endif // CONTENT_PUBLIC_BROWSER_RENDER_VIEW_HOST_H_ |
| OLD | NEW |