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 RenderProcessHost; |
40 class RenderViewHostDelegate; | 41 class RenderViewHostDelegate; |
41 class SessionStorageNamespace; | 42 class SessionStorageNamespace; |
42 class SiteInstance; | 43 class SiteInstance; |
43 struct CustomContextMenuContext; | 44 struct CustomContextMenuContext; |
44 | 45 |
45 // A RenderViewHost is responsible for creating and talking to a RenderView | 46 // 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 | 47 // 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, | 48 // like loading pages, adjusting the display and other browser functionality, |
48 // which it translates into IPC messages sent over the IPC channel with the | 49 // 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 | 50 // 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 | 51 // cracks them, calling a delegate object back with higher level types where |
51 // possible. | 52 // possible. |
52 // | 53 // |
53 // The intent of this interface is to provide a view-agnostic communication | 54 // 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 | 55 // 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. | 56 // WebContents (see WebContents for an example) but also as views, etc. |
56 class CONTENT_EXPORT RenderViewHost : virtual public RenderWidgetHost { | 57 class CONTENT_EXPORT RenderViewHost : virtual public RenderWidgetHost { |
57 public: | 58 public: |
58 // Returns the RenderViewHost given its ID and the ID of its render process. | 59 // 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. | 60 // Returns NULL if the IDs do not correspond to a live RenderViewHost. |
60 static RenderViewHost* FromID(int render_process_id, int render_view_id); | 61 static RenderViewHost* FromID(int render_process_id, int render_view_id); |
61 | 62 |
62 // Downcasts from a RenderWidgetHost to a RenderViewHost. Required | 63 // Downcasts from a RenderWidgetHost to a RenderViewHost. Required |
63 // because RenderWidgetHost is a virtual base class. | 64 // because RenderWidgetHost is a virtual base class. |
64 static RenderViewHost* From(RenderWidgetHost* rwh); | 65 static RenderViewHost* From(RenderWidgetHost* rwh); |
65 | 66 |
66 // Checks that the given renderer can request |url|, if not it sets it to | 67 // Checks that the given renderer can request |url|, if not it sets it to |
67 // about:blank. | 68 // about:blank. |
68 // |empty_allowed| must be set to false for navigations for security reasons. | 69 // |empty_allowed| must be set to false for navigations for security reasons. |
69 static void FilterURL(int renderer_id, | 70 static void FilterURL(const RenderProcessHost* process, |
70 bool empty_allowed, | 71 bool empty_allowed, |
71 GURL* url); | 72 GURL* url); |
72 | 73 |
73 virtual ~RenderViewHost() {} | 74 virtual ~RenderViewHost() {} |
74 | 75 |
75 // Tell the render view to enable a set of javascript bindings. The argument | 76 // Tell the render view to enable a set of javascript bindings. The argument |
76 // should be a combination of values from BindingsPolicy. | 77 // should be a combination of values from BindingsPolicy. |
77 virtual void AllowBindings(int binding_flags) = 0; | 78 virtual void AllowBindings(int binding_flags) = 0; |
78 | 79 |
79 // Tells the renderer to clear the focused node (if any). | 80 // 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, | 285 const WebKit::WebFindOptions& options, |
285 int* match_count, | 286 int* match_count, |
286 int* active_ordinal) = 0; | 287 int* active_ordinal) = 0; |
287 #endif | 288 #endif |
288 | 289 |
289 }; | 290 }; |
290 | 291 |
291 } // namespace content | 292 } // namespace content |
292 | 293 |
293 #endif // CONTENT_PUBLIC_BROWSER_RENDER_VIEW_HOST_H_ | 294 #endif // CONTENT_PUBLIC_BROWSER_RENDER_VIEW_HOST_H_ |
OLD | NEW |