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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <string> | 10 #include <string> |
(...skipping 24 matching lines...) Expand all Loading... |
35 struct WebCompositionUnderline; | 35 struct WebCompositionUnderline; |
36 struct WebScreenInfo; | 36 struct WebScreenInfo; |
37 } | 37 } |
38 | 38 |
39 class BackingStore; | 39 class BackingStore; |
40 class PaintObserver; | 40 class PaintObserver; |
41 class RenderProcessHost; | 41 class RenderProcessHost; |
42 class RenderWidgetHostView; | 42 class RenderWidgetHostView; |
43 class RenderWidgetHostPaintingObserver; | 43 class RenderWidgetHostPaintingObserver; |
44 class TransportDIB; | 44 class TransportDIB; |
45 class VideoLayer; | |
46 class WebCursor; | 45 class WebCursor; |
47 struct ViewHostMsg_ShowPopup_Params; | 46 struct ViewHostMsg_ShowPopup_Params; |
48 struct ViewHostMsg_UpdateRect_Params; | 47 struct ViewHostMsg_UpdateRect_Params; |
49 | 48 |
50 // This class manages the browser side of a browser<->renderer HWND connection. | 49 // This class manages the browser side of a browser<->renderer HWND connection. |
51 // The HWND lives in the browser process, and windows events are sent over | 50 // The HWND lives in the browser process, and windows events are sent over |
52 // IPC to the corresponding object in the renderer. The renderer paints into | 51 // IPC to the corresponding object in the renderer. The renderer paints into |
53 // shared memory, which we transfer to a backing store and blit to the screen | 52 // shared memory, which we transfer to a backing store and blit to the screen |
54 // when Windows sends us a WM_PAINT message. | 53 // when Windows sends us a WM_PAINT message. |
55 // | 54 // |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 // When a backing store does asynchronous painting, it will call this function | 240 // When a backing store does asynchronous painting, it will call this function |
242 // when it is done with the DIB. We will then forward a message to the | 241 // when it is done with the DIB. We will then forward a message to the |
243 // renderer to send another paint. | 242 // renderer to send another paint. |
244 void DonePaintingToBackingStore(); | 243 void DonePaintingToBackingStore(); |
245 | 244 |
246 // GPU accelerated version of GetBackingStore function. This will | 245 // GPU accelerated version of GetBackingStore function. This will |
247 // trigger a re-composite to the view. If a resize is pending, it will | 246 // trigger a re-composite to the view. If a resize is pending, it will |
248 // block briefly waiting for an ack from the renderer. | 247 // block briefly waiting for an ack from the renderer. |
249 void ScheduleComposite(); | 248 void ScheduleComposite(); |
250 | 249 |
251 // Returns the video layer if it exists, NULL otherwise. | |
252 VideoLayer* video_layer() const { return video_layer_.get(); } | |
253 | |
254 // Starts a hang monitor timeout. If there's already a hang monitor timeout | 250 // Starts a hang monitor timeout. If there's already a hang monitor timeout |
255 // the new one will only fire if it has a shorter delay than the time | 251 // the new one will only fire if it has a shorter delay than the time |
256 // left on the existing timeouts. | 252 // left on the existing timeouts. |
257 void StartHangMonitorTimeout(base::TimeDelta delay); | 253 void StartHangMonitorTimeout(base::TimeDelta delay); |
258 | 254 |
259 // Restart the active hang monitor timeout. Clears all existing timeouts and | 255 // Restart the active hang monitor timeout. Clears all existing timeouts and |
260 // starts with a new one. This can be because the renderer has become | 256 // starts with a new one. This can be because the renderer has become |
261 // active, the tab is being hidden, or the user has chosen to wait some more | 257 // active, the tab is being hidden, or the user has chosen to wait some more |
262 // to give the tab a chance to become active and we don't want to display a | 258 // to give the tab a chance to become active and we don't want to display a |
263 // warning too soon. | 259 // warning too soon. |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 // NotifyRendererResponsive. | 468 // NotifyRendererResponsive. |
473 void RendererIsResponsive(); | 469 void RendererIsResponsive(); |
474 | 470 |
475 // IPC message handlers | 471 // IPC message handlers |
476 void OnMsgRenderViewReady(); | 472 void OnMsgRenderViewReady(); |
477 void OnMsgRenderViewGone(); | 473 void OnMsgRenderViewGone(); |
478 void OnMsgClose(); | 474 void OnMsgClose(); |
479 void OnMsgRequestMove(const gfx::Rect& pos); | 475 void OnMsgRequestMove(const gfx::Rect& pos); |
480 void OnMsgPaintAtSizeAck(int tag, const gfx::Size& size); | 476 void OnMsgPaintAtSizeAck(int tag, const gfx::Size& size); |
481 void OnMsgUpdateRect(const ViewHostMsg_UpdateRect_Params& params); | 477 void OnMsgUpdateRect(const ViewHostMsg_UpdateRect_Params& params); |
482 void OnMsgCreateVideo(const gfx::Size& size); | |
483 void OnMsgUpdateVideo(TransportDIB::Id bitmap, const gfx::Rect& bitmap_rect); | |
484 void OnMsgDestroyVideo(); | |
485 void OnMsgInputEventAck(const IPC::Message& message); | 478 void OnMsgInputEventAck(const IPC::Message& message); |
486 virtual void OnMsgFocus(); | 479 virtual void OnMsgFocus(); |
487 virtual void OnMsgBlur(); | 480 virtual void OnMsgBlur(); |
488 | 481 |
489 void OnMsgSetCursor(const WebCursor& cursor); | 482 void OnMsgSetCursor(const WebCursor& cursor); |
490 void OnMsgImeUpdateTextInputState(WebKit::WebTextInputType type, | 483 void OnMsgImeUpdateTextInputState(WebKit::WebTextInputType type, |
491 const gfx::Rect& caret_rect); | 484 const gfx::Rect& caret_rect); |
492 void OnMsgImeCancelComposition(); | 485 void OnMsgImeCancelComposition(); |
493 | 486 |
494 void OnMsgGpuRenderingActivated(bool activated); | 487 void OnMsgGpuRenderingActivated(bool activated); |
(...skipping 17 matching lines...) Expand all Loading... |
512 int32 height, | 505 int32 height, |
513 TransportDIB::Handle transport_dib); | 506 TransportDIB::Handle transport_dib); |
514 void OnAcceleratedSurfaceBuffersSwapped(gfx::PluginWindowHandle window, | 507 void OnAcceleratedSurfaceBuffersSwapped(gfx::PluginWindowHandle window, |
515 uint64 surface_id); | 508 uint64 surface_id); |
516 #elif defined(OS_POSIX) | 509 #elif defined(OS_POSIX) |
517 void OnMsgCreatePluginContainer(gfx::PluginWindowHandle id); | 510 void OnMsgCreatePluginContainer(gfx::PluginWindowHandle id); |
518 void OnMsgDestroyPluginContainer(gfx::PluginWindowHandle id); | 511 void OnMsgDestroyPluginContainer(gfx::PluginWindowHandle id); |
519 #endif | 512 #endif |
520 | 513 |
521 // Paints the given bitmap to the current backing store at the given location. | 514 // Paints the given bitmap to the current backing store at the given location. |
522 // |*painted_synchronously| will be true if the message was processed | |
523 // synchronously, and the bitmap is done being used. False means that the | |
524 // backing store will paint the bitmap at a later time and that the DIB can't | |
525 // be freed (it will be the backing store's job to free it later). | |
526 void PaintBackingStoreRect(TransportDIB::Id bitmap, | 515 void PaintBackingStoreRect(TransportDIB::Id bitmap, |
527 const gfx::Rect& bitmap_rect, | 516 const gfx::Rect& bitmap_rect, |
528 const std::vector<gfx::Rect>& copy_rects, | 517 const std::vector<gfx::Rect>& copy_rects, |
529 const gfx::Size& view_size, | 518 const gfx::Size& view_size); |
530 bool* painted_synchronously); | |
531 | 519 |
532 // Scrolls the given |clip_rect| in the backing by the given dx/dy amount. The | 520 // Scrolls the given |clip_rect| in the backing by the given dx/dy amount. The |
533 // |dib| and its corresponding location |bitmap_rect| in the backing store | 521 // |dib| and its corresponding location |bitmap_rect| in the backing store |
534 // is the newly painted pixels by the renderer. | 522 // is the newly painted pixels by the renderer. |
535 void ScrollBackingStoreRect(int dx, int dy, const gfx::Rect& clip_rect, | 523 void ScrollBackingStoreRect(int dx, int dy, const gfx::Rect& clip_rect, |
536 const gfx::Size& view_size); | 524 const gfx::Size& view_size); |
537 | 525 |
538 // Paints the entire given bitmap into the current video layer, if it exists. | |
539 // |bitmap_rect| specifies the destination size and absolute location of the | |
540 // bitmap on the backing store. | |
541 void PaintVideoLayer(TransportDIB::Id bitmap, | |
542 const gfx::Rect& bitmap_rect); | |
543 | |
544 // Called by OnMsgInputEventAck() to process a keyboard event ack message. | 526 // Called by OnMsgInputEventAck() to process a keyboard event ack message. |
545 void ProcessKeyboardEventAck(int type, bool processed); | 527 void ProcessKeyboardEventAck(int type, bool processed); |
546 | 528 |
547 // Called by OnMsgInputEventAck() to process a wheel event ack message. | 529 // Called by OnMsgInputEventAck() to process a wheel event ack message. |
548 // This could result in a task being posted to allow additional wheel | 530 // This could result in a task being posted to allow additional wheel |
549 // input messages to be coalesced. | 531 // input messages to be coalesced. |
550 void ProcessWheelAck(); | 532 void ProcessWheelAck(); |
551 | 533 |
552 // True if renderer accessibility is enabled. This should only be set when a | 534 // True if renderer accessibility is enabled. This should only be set when a |
553 // screenreader is detected as it can potentially slow down Chrome. | 535 // screenreader is detected as it can potentially slow down Chrome. |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 // shall not send the following sequence of Char events, which was generated | 665 // shall not send the following sequence of Char events, which was generated |
684 // by this RawKeyDown event, to the renderer. Otherwise the renderer may | 666 // by this RawKeyDown event, to the renderer. Otherwise the renderer may |
685 // handle the Char events and cause unexpected behavior. | 667 // handle the Char events and cause unexpected behavior. |
686 // For example, pressing alt-2 may let the browser switch to the second tab, | 668 // For example, pressing alt-2 may let the browser switch to the second tab, |
687 // but the Char event generated by alt-2 may also activate a HTML element | 669 // but the Char event generated by alt-2 may also activate a HTML element |
688 // if its accesskey happens to be "2", then the user may get confused when | 670 // if its accesskey happens to be "2", then the user may get confused when |
689 // switching back to the original tab, because the content may already be | 671 // switching back to the original tab, because the content may already be |
690 // changed. | 672 // changed. |
691 bool suppress_next_char_events_; | 673 bool suppress_next_char_events_; |
692 | 674 |
693 // Optional video YUV layer for used for out-of-process compositing. | |
694 scoped_ptr<VideoLayer> video_layer_; | |
695 | |
696 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); | 675 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); |
697 }; | 676 }; |
698 | 677 |
699 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 678 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
OLD | NEW |