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 #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" |
| 11 #include "content/public/browser/render_widget_host.h" | 11 #include "content/public/browser/render_widget_host.h" |
| 12 #include "content/public/common/page_zoom.h" | 12 #include "content/public/common/page_zoom.h" |
| 13 #include "content/public/common/stop_find_action.h" | 13 #include "content/public/common/stop_find_action.h" |
| 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" |
| 15 | 15 |
| 16 class FilePath; | 16 class FilePath; |
| 17 class GURL; | 17 class GURL; |
| 18 struct WebDropData; | 18 struct WebDropData; |
| 19 struct WebPreferences; | 19 struct WebPreferences; |
| 20 | 20 |
| 21 namespace content { | |
| 22 class RenderViewHostDelegate; | |
| 23 class SessionStorageNamespace; | |
| 24 class SiteInstance; | |
| 25 struct CustomContextMenuContext; | |
| 26 } | |
| 27 | |
| 28 namespace gfx { | 21 namespace gfx { |
| 29 class Point; | 22 class Point; |
| 30 } | 23 } |
| 31 | 24 |
| 32 namespace WebKit { | 25 namespace WebKit { |
| 33 struct WebFindOptions; | 26 struct WebFindOptions; |
| 34 struct WebMediaPlayerAction; | 27 struct WebMediaPlayerAction; |
| 35 struct WebPluginAction; | 28 struct WebPluginAction; |
| 36 } | 29 } |
| 37 | 30 |
| 31 namespace content { | |
| 32 | |
| 33 class RenderViewHostDelegate; | |
| 34 class SessionStorageNamespace; | |
| 35 class SiteInstance; | |
| 36 struct CustomContextMenuContext; | |
| 37 | |
| 38 // A RenderViewHost is responsible for creating and talking to a RenderView | 38 // A RenderViewHost is responsible for creating and talking to a RenderView |
| 39 // object in a child process. It exposes a high level API to users, for things | 39 // object in a child process. It exposes a high level API to users, for things |
| 40 // like loading pages, adjusting the display and other browser functionality, | 40 // like loading pages, adjusting the display and other browser functionality, |
| 41 // which it translates into IPC messages sent over the IPC channel with the | 41 // which it translates into IPC messages sent over the IPC channel with the |
| 42 // RenderView. It responds to all IPC messages sent by that RenderView and | 42 // RenderView. It responds to all IPC messages sent by that RenderView and |
| 43 // cracks them, calling a delegate object back with higher level types where | 43 // cracks them, calling a delegate object back with higher level types where |
| 44 // possible. | 44 // possible. |
| 45 // | 45 // |
| 46 // The intent of this interface is to provide a view-agnostic communication | 46 // The intent of this interface is to provide a view-agnostic communication |
| 47 // conduit with a renderer. This is so we can build HTML views not only as | 47 // conduit with a renderer. This is so we can build HTML views not only as |
| 48 // TabContents (see TabContents for an example) but also as views, etc. | 48 // TabContents (see TabContents for an example) but also as views, etc. |
| 49 // | |
| 50 // TODO(joi): Move to content namespace. | |
| 51 class CONTENT_EXPORT RenderViewHost : virtual public RenderWidgetHost { | 49 class CONTENT_EXPORT RenderViewHost : virtual public RenderWidgetHost { |
| 52 public: | 50 public: |
| 53 // Returns the RenderViewHost given its ID and the ID of its render process. | 51 // Returns the RenderViewHost given its ID and the ID of its render process. |
| 54 // Returns NULL if the IDs do not correspond to a live RenderViewHost. | 52 // Returns NULL if the IDs do not correspond to a live RenderViewHost. |
| 55 static RenderViewHost* FromID(int render_process_id, int render_view_id); | 53 static RenderViewHost* FromID(int render_process_id, int render_view_id); |
| 56 | 54 |
| 57 // Downcasts from a RenderWidgetHost to a RenderViewHost. Required | 55 // Downcasts from a RenderWidgetHost to a RenderViewHost. Required |
| 58 // because RenderWidgetHost is a virtual base class. | 56 // because RenderWidgetHost is a virtual base class. |
| 59 static RenderViewHost* From(RenderWidgetHost* rwh); | 57 static RenderViewHost* From(RenderWidgetHost* rwh); |
| 60 | 58 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 135 const gfx::Size& max_size) = 0; | 133 const gfx::Size& max_size) = 0; |
| 136 | 134 |
| 137 // Turns off auto-resize and gives a new size that the view should be. | 135 // Turns off auto-resize and gives a new size that the view should be. |
| 138 virtual void DisableAutoResize(const gfx::Size& new_size) = 0; | 136 virtual void DisableAutoResize(const gfx::Size& new_size) = 0; |
| 139 | 137 |
| 140 // Instructs the RenderView to send back updates to the preferred size. | 138 // Instructs the RenderView to send back updates to the preferred size. |
| 141 virtual void EnablePreferredSizeMode() = 0; | 139 virtual void EnablePreferredSizeMode() = 0; |
| 142 | 140 |
| 143 // Executes custom context menu action that was provided from WebKit. | 141 // Executes custom context menu action that was provided from WebKit. |
| 144 virtual void ExecuteCustomContextMenuCommand( | 142 virtual void ExecuteCustomContextMenuCommand( |
| 145 int action, const content::CustomContextMenuContext& context) = 0; | 143 int action, const content::CustomContextMenuContext& context) = 0; |
|
jam
2012/03/05 23:59:28
ditto
Jói
2012/03/06 16:38:55
Done.
| |
| 146 | 144 |
| 147 // Tells the renderer to perform the given action on the media player | 145 // Tells the renderer to perform the given action on the media player |
| 148 // located at the given point. | 146 // located at the given point. |
| 149 virtual void ExecuteMediaPlayerActionAtLocation( | 147 virtual void ExecuteMediaPlayerActionAtLocation( |
| 150 const gfx::Point& location, | 148 const gfx::Point& location, |
| 151 const WebKit::WebMediaPlayerAction& action) = 0; | 149 const WebKit::WebMediaPlayerAction& action) = 0; |
| 152 | 150 |
| 153 // Runs some javascript within the context of a frame in the page. | 151 // Runs some javascript within the context of a frame in the page. |
| 154 virtual void ExecuteJavascriptInWebFrame(const string16& frame_xpath, | 152 virtual void ExecuteJavascriptInWebFrame(const string16& frame_xpath, |
| 155 const string16& jscript) = 0; | 153 const string16& jscript) = 0; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 242 // Send the renderer process the current preferences supplied by the | 240 // Send the renderer process the current preferences supplied by the |
| 243 // RenderViewHostDelegate. | 241 // RenderViewHostDelegate. |
| 244 virtual void SyncRendererPrefs() = 0; | 242 virtual void SyncRendererPrefs() = 0; |
| 245 | 243 |
| 246 virtual void ToggleSpeechInput() = 0; | 244 virtual void ToggleSpeechInput() = 0; |
| 247 | 245 |
| 248 // Passes a list of Webkit preferences to the renderer. | 246 // Passes a list of Webkit preferences to the renderer. |
| 249 virtual void UpdateWebkitPreferences(const WebPreferences& prefs) = 0; | 247 virtual void UpdateWebkitPreferences(const WebPreferences& prefs) = 0; |
| 250 }; | 248 }; |
| 251 | 249 |
| 250 } // namespace content | |
| 252 | 251 |
| 253 #endif // CONTENT_PUBLIC_BROWSER_RENDER_VIEW_HOST_H_ | 252 #endif // CONTENT_PUBLIC_BROWSER_RENDER_VIEW_HOST_H_ |
| OLD | NEW |