| 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_WIDGET_HOST_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ | 6 #define CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 #include "content/public/browser/native_web_keyboard_event.h" | 10 #include "content/public/browser/native_web_keyboard_event.h" |
| 11 #include "ipc/ipc_channel.h" | 11 #include "ipc/ipc_channel.h" |
| 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 12 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" | 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" |
| 14 #include "ui/gfx/size.h" | 14 #include "ui/gfx/size.h" |
| 15 #include "ui/gfx/surface/transport_dib.h" | 15 #include "ui/gfx/surface/transport_dib.h" |
| 16 | 16 |
| 17 #if defined(TOOLKIT_GTK) | 17 #if defined(TOOLKIT_GTK) |
| 18 #include "ui/base/x/x11_util.h" | 18 #include "ui/base/x/x11_util.h" |
| 19 #elif defined(OS_MACOSX) | 19 #elif defined(OS_MACOSX) |
| 20 #include "skia/ext/platform_device.h" | 20 #include "skia/ext/platform_device.h" |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 class RenderWidgetHostImpl; | |
| 24 | |
| 25 namespace content { | |
| 26 class RenderProcessHost; | |
| 27 class RenderWidgetHostView; | |
| 28 } | |
| 29 | |
| 30 namespace gfx { | 23 namespace gfx { |
| 31 class Rect; | 24 class Rect; |
| 32 } | 25 } |
| 33 | 26 |
| 34 namespace skia { | 27 namespace skia { |
| 35 class PlatformCanvas; | 28 class PlatformCanvas; |
| 36 } | 29 } |
| 37 | 30 |
| 31 namespace content { |
| 32 |
| 33 class RenderProcessHost; |
| 34 class RenderWidgetHostImpl; |
| 35 class RenderWidgetHostView; |
| 36 |
| 38 // A RenderWidgetHost manages the browser side of a browser<->renderer | 37 // A RenderWidgetHost manages the browser side of a browser<->renderer |
| 39 // HWND connection. The HWND lives in the browser process, and | 38 // HWND connection. The HWND lives in the browser process, and |
| 40 // windows events are sent over IPC to the corresponding object in the | 39 // windows events are sent over IPC to the corresponding object in the |
| 41 // renderer. The renderer paints into shared memory, which we | 40 // renderer. The renderer paints into shared memory, which we |
| 42 // transfer to a backing store and blit to the screen when Windows | 41 // transfer to a backing store and blit to the screen when Windows |
| 43 // sends us a WM_PAINT message. | 42 // sends us a WM_PAINT message. |
| 44 // | 43 // |
| 45 // How Shutdown Works | 44 // How Shutdown Works |
| 46 // | 45 // |
| 47 // There are two situations in which this object, a RenderWidgetHost, can be | 46 // There are two situations in which this object, a RenderWidgetHost, can be |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // the view when it has received a message. | 197 // the view when it has received a message. |
| 199 virtual void ForwardMouseEvent( | 198 virtual void ForwardMouseEvent( |
| 200 const WebKit::WebMouseEvent& mouse_event) = 0; | 199 const WebKit::WebMouseEvent& mouse_event) = 0; |
| 201 virtual void ForwardWheelEvent( | 200 virtual void ForwardWheelEvent( |
| 202 const WebKit::WebMouseWheelEvent& wheel_event) = 0; | 201 const WebKit::WebMouseWheelEvent& wheel_event) = 0; |
| 203 virtual void ForwardKeyboardEvent( | 202 virtual void ForwardKeyboardEvent( |
| 204 const NativeWebKeyboardEvent& key_event) = 0; | 203 const NativeWebKeyboardEvent& key_event) = 0; |
| 205 | 204 |
| 206 virtual const gfx::Point& GetLastScrollOffset() const = 0; | 205 virtual const gfx::Point& GetLastScrollOffset() const = 0; |
| 207 | 206 |
| 208 virtual content::RenderProcessHost* GetProcess() const = 0; | 207 virtual RenderProcessHost* GetProcess() const = 0; |
| 209 | 208 |
| 210 virtual int GetRoutingID() const = 0; | 209 virtual int GetRoutingID() const = 0; |
| 211 | 210 |
| 212 // Gets the View of this RenderWidgetHost. Can be NULL, e.g. if the | 211 // Gets the View of this RenderWidgetHost. Can be NULL, e.g. if the |
| 213 // RenderWidget is being destroyed or the render process crashed. You should | 212 // RenderWidget is being destroyed or the render process crashed. You should |
| 214 // never cache this pointer since it can become NULL if the renderer crashes, | 213 // never cache this pointer since it can become NULL if the renderer crashes, |
| 215 // instead you should always ask for it using the accessor. | 214 // instead you should always ask for it using the accessor. |
| 216 virtual content::RenderWidgetHostView* GetView() const = 0; | 215 virtual RenderWidgetHostView* GetView() const = 0; |
| 217 | 216 |
| 218 // Returns true if this is a RenderViewHost, false if not. | 217 // Returns true if this is a RenderViewHost, false if not. |
| 219 virtual bool IsRenderView() const = 0; | 218 virtual bool IsRenderView() const = 0; |
| 220 | 219 |
| 221 // Used as the details object for a | 220 // Used as the details object for a |
| 222 // RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK notification. | 221 // RENDER_WIDGET_HOST_DID_RECEIVE_PAINT_AT_SIZE_ACK notification. |
| 223 // TODO(joi): Switch out for a std::pair. | 222 // TODO(joi): Switch out for a std::pair. |
| 224 struct PaintAtSizeAckDetails { | 223 struct PaintAtSizeAckDetails { |
| 225 // The tag that was passed to the PaintAtSize() call that triggered this | 224 // The tag that was passed to the PaintAtSize() call that triggered this |
| 226 // ack. | 225 // ack. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 friend class RenderWidgetHostImpl; | 279 friend class RenderWidgetHostImpl; |
| 281 | 280 |
| 282 // Retrieves the implementation class. Intended only for code | 281 // Retrieves the implementation class. Intended only for code |
| 283 // within content/. This method is necessary because | 282 // within content/. This method is necessary because |
| 284 // RenderWidgetHost is the root of a diamond inheritance pattern, so | 283 // RenderWidgetHost is the root of a diamond inheritance pattern, so |
| 285 // subclasses inherit it virtually, which removes our ability to | 284 // subclasses inherit it virtually, which removes our ability to |
| 286 // static_cast to the subclass. | 285 // static_cast to the subclass. |
| 287 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; | 286 virtual RenderWidgetHostImpl* AsRenderWidgetHostImpl() = 0; |
| 288 }; | 287 }; |
| 289 | 288 |
| 289 } // namespace content |
| 290 |
| 290 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ | 291 #endif // CONTENT_PUBLIC_BROWSER_RENDER_WIDGET_HOST_H_ |
| OLD | NEW |