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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 15 matching lines...) Expand all Loading... | |
26 } | 26 } |
27 | 27 |
28 namespace WebKit { | 28 namespace WebKit { |
29 struct WebFindOptions; | 29 struct WebFindOptions; |
30 struct WebMediaPlayerAction; | 30 struct WebMediaPlayerAction; |
31 struct WebPluginAction; | 31 struct WebPluginAction; |
32 } | 32 } |
33 | 33 |
34 namespace content { | 34 namespace content { |
35 | 35 |
36 class ChildProcessSecurityPolicy; | |
36 class RenderViewHostDelegate; | 37 class RenderViewHostDelegate; |
37 class SessionStorageNamespace; | 38 class SessionStorageNamespace; |
38 class SiteInstance; | 39 class SiteInstance; |
39 struct CustomContextMenuContext; | 40 struct CustomContextMenuContext; |
40 struct SelectedFileInfo; | 41 struct SelectedFileInfo; |
41 | 42 |
42 // A RenderViewHost is responsible for creating and talking to a RenderView | 43 // A RenderViewHost is responsible for creating and talking to a RenderView |
43 // object in a child process. It exposes a high level API to users, for things | 44 // object in a child process. It exposes a high level API to users, for things |
44 // like loading pages, adjusting the display and other browser functionality, | 45 // like loading pages, adjusting the display and other browser functionality, |
45 // which it translates into IPC messages sent over the IPC channel with the | 46 // which it translates into IPC messages sent over the IPC channel with the |
46 // RenderView. It responds to all IPC messages sent by that RenderView and | 47 // RenderView. It responds to all IPC messages sent by that RenderView and |
47 // cracks them, calling a delegate object back with higher level types where | 48 // cracks them, calling a delegate object back with higher level types where |
48 // possible. | 49 // possible. |
49 // | 50 // |
50 // The intent of this interface is to provide a view-agnostic communication | 51 // The intent of this interface is to provide a view-agnostic communication |
51 // conduit with a renderer. This is so we can build HTML views not only as | 52 // conduit with a renderer. This is so we can build HTML views not only as |
52 // WebContents (see WebContents for an example) but also as views, etc. | 53 // WebContents (see WebContents for an example) but also as views, etc. |
53 class CONTENT_EXPORT RenderViewHost : virtual public RenderWidgetHost { | 54 class CONTENT_EXPORT RenderViewHost : virtual public RenderWidgetHost { |
54 public: | 55 public: |
55 // Returns the RenderViewHost given its ID and the ID of its render process. | 56 // Returns the RenderViewHost given its ID and the ID of its render process. |
56 // Returns NULL if the IDs do not correspond to a live RenderViewHost. | 57 // Returns NULL if the IDs do not correspond to a live RenderViewHost. |
57 static RenderViewHost* FromID(int render_process_id, int render_view_id); | 58 static RenderViewHost* FromID(int render_process_id, int render_view_id); |
58 | 59 |
59 // Downcasts from a RenderWidgetHost to a RenderViewHost. Required | 60 // Downcasts from a RenderWidgetHost to a RenderViewHost. Required |
60 // because RenderWidgetHost is a virtual base class. | 61 // because RenderWidgetHost is a virtual base class. |
61 static RenderViewHost* From(RenderWidgetHost* rwh); | 62 static RenderViewHost* From(RenderWidgetHost* rwh); |
62 | 63 |
64 // Checks that the given renderer can request |url|, if not it sets it to | |
65 // about:blank. | |
66 // empty_allowed must be set to false for navigations for security reasons. | |
67 static void FilterURL(ChildProcessSecurityPolicy* policy, | |
darin (slow to review)
2012/06/01 20:57:41
it seems like you shouldn't bother with the policy
mkosiba (inactive)
2012/06/06 16:11:20
Done.
| |
68 int renderer_id, | |
69 bool empty_allowed, | |
70 GURL* url); | |
71 | |
63 virtual ~RenderViewHost() {} | 72 virtual ~RenderViewHost() {} |
64 | 73 |
65 // Tell the render view to enable a set of javascript bindings. The argument | 74 // Tell the render view to enable a set of javascript bindings. The argument |
66 // should be a combination of values from BindingsPolicy. | 75 // should be a combination of values from BindingsPolicy. |
67 virtual void AllowBindings(int binding_flags) = 0; | 76 virtual void AllowBindings(int binding_flags) = 0; |
68 | 77 |
69 // Tells the renderer to clear the focused node (if any). | 78 // Tells the renderer to clear the focused node (if any). |
70 virtual void ClearFocusedNode() = 0; | 79 virtual void ClearFocusedNode() = 0; |
71 | 80 |
72 // Causes the renderer to close the current page, including running its | 81 // Causes the renderer to close the current page, including running its |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
255 virtual webkit_glue::WebPreferences GetWebkitPreferences() = 0; | 264 virtual webkit_glue::WebPreferences GetWebkitPreferences() = 0; |
256 | 265 |
257 // Passes a list of Webkit preferences to the renderer. | 266 // Passes a list of Webkit preferences to the renderer. |
258 virtual void UpdateWebkitPreferences( | 267 virtual void UpdateWebkitPreferences( |
259 const webkit_glue::WebPreferences& prefs) = 0; | 268 const webkit_glue::WebPreferences& prefs) = 0; |
260 }; | 269 }; |
261 | 270 |
262 } // namespace content | 271 } // namespace content |
263 | 272 |
264 #endif // CONTENT_PUBLIC_BROWSER_RENDER_VIEW_HOST_H_ | 273 #endif // CONTENT_PUBLIC_BROWSER_RENDER_VIEW_HOST_H_ |
OLD | NEW |