| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "app/gfx/native_widget_types.h" | 10 #include "app/gfx/native_widget_types.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 struct WebScreenInfo; | 31 struct WebScreenInfo; |
| 32 } | 32 } |
| 33 | 33 |
| 34 class BackingStore; | 34 class BackingStore; |
| 35 class PaintObserver; | 35 class PaintObserver; |
| 36 class RenderProcessHost; | 36 class RenderProcessHost; |
| 37 class RenderWidgetHostView; | 37 class RenderWidgetHostView; |
| 38 class RenderWidgetHostPaintingObserver; | 38 class RenderWidgetHostPaintingObserver; |
| 39 class TransportDIB; | 39 class TransportDIB; |
| 40 class WebCursor; | 40 class WebCursor; |
| 41 struct ViewHostMsg_PaintRect_Params; |
| 42 struct ViewHostMsg_ScrollRect_Params; |
| 41 struct ViewHostMsg_ShowPopup_Params; | 43 struct ViewHostMsg_ShowPopup_Params; |
| 42 struct ViewHostMsg_UpdateRect_Params; | |
| 43 | 44 |
| 44 // This class manages the browser side of a browser<->renderer HWND connection. | 45 // This class manages the browser side of a browser<->renderer HWND connection. |
| 45 // The HWND lives in the browser process, and windows events are sent over | 46 // The HWND lives in the browser process, and windows events are sent over |
| 46 // IPC to the corresponding object in the renderer. The renderer paints into | 47 // IPC to the corresponding object in the renderer. The renderer paints into |
| 47 // shared memory, which we transfer to a backing store and blit to the screen | 48 // shared memory, which we transfer to a backing store and blit to the screen |
| 48 // when Windows sends us a WM_PAINT message. | 49 // when Windows sends us a WM_PAINT message. |
| 49 // | 50 // |
| 50 // How Shutdown Works | 51 // How Shutdown Works |
| 51 // | 52 // |
| 52 // There are two situations in which this object, a RenderWidgetHost, can be | 53 // There are two situations in which this object, a RenderWidgetHost, can be |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 // Called if we know the renderer is responsive. When we currently thing the | 406 // Called if we know the renderer is responsive. When we currently thing the |
| 406 // renderer is unresponsive, this will clear that state and call | 407 // renderer is unresponsive, this will clear that state and call |
| 407 // NotifyRendererResponsive. | 408 // NotifyRendererResponsive. |
| 408 void RendererIsResponsive(); | 409 void RendererIsResponsive(); |
| 409 | 410 |
| 410 // IPC message handlers | 411 // IPC message handlers |
| 411 void OnMsgRenderViewReady(); | 412 void OnMsgRenderViewReady(); |
| 412 void OnMsgRenderViewGone(); | 413 void OnMsgRenderViewGone(); |
| 413 void OnMsgClose(); | 414 void OnMsgClose(); |
| 414 void OnMsgRequestMove(const gfx::Rect& pos); | 415 void OnMsgRequestMove(const gfx::Rect& pos); |
| 415 void OnMsgUpdateRect(const ViewHostMsg_UpdateRect_Params& params); | 416 void OnMsgPaintRect(const ViewHostMsg_PaintRect_Params& params); |
| 417 void OnMsgScrollRect(const ViewHostMsg_ScrollRect_Params& params); |
| 416 void OnMsgInputEventAck(const IPC::Message& message); | 418 void OnMsgInputEventAck(const IPC::Message& message); |
| 417 void OnMsgFocus(); | 419 void OnMsgFocus(); |
| 418 void OnMsgBlur(); | 420 void OnMsgBlur(); |
| 419 virtual void OnMsgFocusedNodeChanged(); | 421 virtual void OnMsgFocusedNodeChanged(); |
| 420 | 422 |
| 421 void OnMsgSetCursor(const WebCursor& cursor); | 423 void OnMsgSetCursor(const WebCursor& cursor); |
| 422 // Using int instead of ViewHostMsg_ImeControl for control's type to avoid | 424 // Using int instead of ViewHostMsg_ImeControl for control's type to avoid |
| 423 // having to bring in render_messages.h in a header file. | 425 // having to bring in render_messages.h in a header file. |
| 424 void OnMsgImeUpdateStatus(int control, const gfx::Rect& caret_rect); | 426 void OnMsgImeUpdateStatus(int control, const gfx::Rect& caret_rect); |
| 425 #if defined(OS_LINUX) | 427 #if defined(OS_LINUX) |
| 426 void OnMsgCreatePluginContainer(gfx::PluginWindowHandle id); | 428 void OnMsgCreatePluginContainer(gfx::PluginWindowHandle id); |
| 427 void OnMsgDestroyPluginContainer(gfx::PluginWindowHandle id); | 429 void OnMsgDestroyPluginContainer(gfx::PluginWindowHandle id); |
| 428 #elif defined(OS_MACOSX) | 430 #elif defined(OS_MACOSX) |
| 429 void OnMsgShowPopup(const ViewHostMsg_ShowPopup_Params& params); | 431 void OnMsgShowPopup(const ViewHostMsg_ShowPopup_Params& params); |
| 430 void OnMsgGetScreenInfo(gfx::NativeViewId view, | 432 void OnMsgGetScreenInfo(gfx::NativeViewId view, |
| 431 WebKit::WebScreenInfo* results); | 433 WebKit::WebScreenInfo* results); |
| 432 void OnMsgGetWindowRect(gfx::NativeViewId window_id, gfx::Rect* results); | 434 void OnMsgGetWindowRect(gfx::NativeViewId window_id, gfx::Rect* results); |
| 433 void OnMsgGetRootWindowRect(gfx::NativeViewId window_id, gfx::Rect* results); | 435 void OnMsgGetRootWindowRect(gfx::NativeViewId window_id, gfx::Rect* results); |
| 434 #endif | 436 #endif |
| 435 | 437 |
| 436 // Paints the given bitmap to the current backing store at the given location. | 438 // Paints the given bitmap to the current backing store at the given location. |
| 437 void PaintBackingStoreRect(TransportDIB* dib, | 439 void PaintBackingStoreRect(TransportDIB* dib, |
| 438 const gfx::Rect& bitmap_rect, | 440 const gfx::Rect& bitmap_rect, |
| 439 const std::vector<gfx::Rect>& copy_rects, | 441 const std::vector<gfx::Rect>& copy_rects, |
| 440 const gfx::Size& view_size); | 442 const gfx::Size& view_size); |
| 441 | 443 |
| 442 // Scrolls the given |clip_rect| in the backing by the given dx/dy amount. The | 444 // Scrolls the given |clip_rect| in the backing by the given dx/dy amount. The |
| 443 // |dib| and its corresponding location |bitmap_rect| in the backing store | 445 // |dib| and its corresponding location |bitmap_rect| in the backing store |
| 444 // is the newly painted pixels by the renderer. | 446 // is the newly painted pixels by the renderer. |
| 445 void ScrollBackingStoreRect(int dx, int dy, const gfx::Rect& clip_rect, | 447 void ScrollBackingStoreRect(TransportDIB* dib, |
| 448 const gfx::Rect& bitmap_rect, |
| 449 int dx, int dy, |
| 450 const gfx::Rect& clip_rect, |
| 446 const gfx::Size& view_size); | 451 const gfx::Size& view_size); |
| 447 | 452 |
| 448 // Called by OnMsgInputEventAck() to process a keyboard event ack message. | 453 // Called by OnMsgInputEventAck() to process a keyboard event ack message. |
| 449 void ProcessKeyboardEventAck(int type, bool processed); | 454 void ProcessKeyboardEventAck(int type, bool processed); |
| 450 | 455 |
| 451 // The View associated with the RenderViewHost. The lifetime of this object | 456 // The View associated with the RenderViewHost. The lifetime of this object |
| 452 // is associated with the lifetime of the Render process. If the Renderer | 457 // is associated with the lifetime of the Render process. If the Renderer |
| 453 // crashes, its View is destroyed and this pointer becomes NULL, even though | 458 // crashes, its View is destroyed and this pointer becomes NULL, even though |
| 454 // render_view_host_ lives on to load another URL (creating a new View while | 459 // render_view_host_ lives on to load another URL (creating a new View while |
| 455 // doing so). | 460 // doing so). |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 // but the Char event generated by alt-2 may also activate a HTML element | 566 // but the Char event generated by alt-2 may also activate a HTML element |
| 562 // if its accesskey happens to be "2", then the user may get confused when | 567 // if its accesskey happens to be "2", then the user may get confused when |
| 563 // switching back to the original tab, because the content may already be | 568 // switching back to the original tab, because the content may already be |
| 564 // changed. | 569 // changed. |
| 565 bool suppress_next_char_events_; | 570 bool suppress_next_char_events_; |
| 566 | 571 |
| 567 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); | 572 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); |
| 568 }; | 573 }; |
| 569 | 574 |
| 570 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 575 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
| OLD | NEW |